Create Classes for Bivariate Maps
Creates mapping classes for a bivariate map. These data will be stored
in a new variable named bi_class
, which will be added to the given
data object.
bi_class(.data, x, y, style = "quantile", dim = 3, keep_factors = FALSE)
.data |
A data frame, tibble, or |
x |
The |
y |
The |
style |
A string identifying the style used to calculate breaks. Currently
supported styles are |
dim |
The dimensions of the palette, either |
keep_factors |
A logical scalar; if |
A copy of .data
with a new variable bi_class
that contains
combinations of values that correspond to an observations values for x
and y
. This is the basis for applying a bivariate color palette.
# quantile breaks, 2x2 data <- bi_class(stl_race_income, x = pctWhite, y = medInc, style = "quantile", dim = 2) # summarize quantile breaks, 2x2 table(data$bi_class) # quantile breaks, 3x3 data <- bi_class(stl_race_income, x = pctWhite, y = medInc, style = "quantile", dim = 3) # summarize quantile breaks, 3x3 table(data$bi_class) # equal breaks data <- bi_class(stl_race_income, x = pctWhite, y = medInc, style = "equal", dim = 3) # summarize equal breaks, 3x3 table(data$bi_class) # fisher breaks data <- bi_class(stl_race_income, x = pctWhite, y = medInc, style = "fisher", dim = 3) # summarize fisher breaks, 3x3 table(data$bi_class) # jenks breaks data <- bi_class(stl_race_income, x = pctWhite, y = medInc, style = "jenks", dim = 3) # summarize jenks breaks, 3x3 table(data$bi_class)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.