Applies the selected palette as the fill aesthetic when geom_sf is used and the bi_class variable is given as the fill in the aesthetic mapping.

bi_scale_fill(pal, dim = 3, ...)

Arguments

pal

A palette name; one of "Brown", "DkBlue", "DkCyan", "DkViolet", or "GrPink".

dim

The dimensions of the palette, either 2 for a two-by-two palette or 3 for a three-by-three palette.

...

Arguments to pass to scale_fill_manual

Value

A ggplot object with the given bivariate palette applied to the data.

Examples

# load suggested dependencies library(ggplot2) library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.1.3, PROJ 4.9.3
# add breaks, 2x2 data <- bi_class(stl_race_income, x = pctWhite, y = medInc, dim = 2) # create map ggplot() + geom_sf(data = data, aes(fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) + bi_scale_fill(pal = "GrPink", dim = 2)
# add breaks, 3x3 data <- bi_class(stl_race_income, x = pctWhite, y = medInc, dim = 3) # create map ggplot() + geom_sf(data = data, aes(fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) + bi_scale_fill(pal = "GrPink", dim = 3)