Advanced demographic mapping

Analyzing US Census Data in R

Kyle Walker

Instructor

Visual variables in cartography

Visual Variables by Axis maps

Analyzing US Census Data in R

Graduated symbol maps

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))
Analyzing US Census Data in R

Graduated symbols

Analyzing US Census Data in R

Faceted plot

Analyzing US Census Data in R

Faceted maps with ggplot2

ggplot(dc_race, aes(fill = percent, color = percent)) + 
  geom_sf() + 
  coord_sf(datum = NA) + 
  facet_wrap(~variable)

Faceted map

Analyzing US Census Data in R

Interactive visualization

  • Web-based graphics allow interaction with data

  • Options in R:

    • leaflet
    • plotly
    • htmlwidgets
Analyzing US Census Data in R

Interactive maps with mapview

library(mapview)
mapview(cook_value, zcol = "estimate", legend = TRUE)

mapview GIF

Analyzing US Census Data in R

Let's practice!

Analyzing US Census Data in R

Preparing Video For Download...