if (FALSE) {
# Texas county income data
library(tidycensus)
tx <- get_acs(geography = "county", variables = "B19013_001",
state = "TX", geometry = TRUE)
# Classification examples
eq_class <- step_equal_interval("estimate", tx$estimate, n = 4)
labels <- get_legend_labels(eq_class, format = "currency")
colors <- get_legend_colors(eq_class)
breaks <- get_breaks(eq_class)
# Continuous scale examples
scale <- interpolate_palette("estimate", tx$estimate, method = "quantile", n = 5)
labels <- get_legend_labels(scale, format = "compact", prefix = "$")
colors <- get_legend_colors(scale)
}
Run the code above in your browser using DataLab