Analyzing US Census Data in R
Kyle Walker
Instructor
library(sf) centers <- st_centroid(state_value)
ggplot() + geom_sf(data = state_value, fill = "white") + geom_sf(data = centers, aes(size = estimate), shape = 21, fill = "lightblue", alpha = 0.7, show.legend = "point") + scale_size_continuous(range = c(1, 20))
ggplot(dc_race, aes(fill = percent, color = percent)) +
geom_sf() +
coord_sf(datum = NA) +
facet_wrap(~variable)
Web-based graphics allow interaction with data
Options in R:
leaflet
plotly
htmlwidgets
library(mapview)
mapview(cook_value, zcol = "estimate", legend = TRUE)
Analyzing US Census Data in R