Description Usage Format Examples
Percent (pct
) of White, Black, Asian, and Hispanic inhabitants in Texas counties.
Data were obtained from the 2010 decennial US Census.
1 |
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1016 rows and 7 columns.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(sf)
texas_race %>%
filter(variable == "White") %>%
ggplot(aes(fill = pct)) +
geom_sf(color = "white") +
coord_sf(datum = NA) +
theme_map() +
#scale_fill_continuous_diverging(palette = "Blue-Red 3", # uncomment for alternative color scale
scale_fill_continuous_carto(palette = "Earth",
mid = 50,
limits = c(0, 100),
breaks = 25*(0:4),
name = "% White") +
theme(legend.title.align = 0.5,
legend.text.align = 0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.