bdill

missing_school_districts_shapefile.R

Jun 4th, 2022 (edited)
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.59 KB | None | 0 0
  1. library(tigris)
  2. library(tidycensus)
  3. library(tidyverse)
  4.  
  5. sd_income <- tidyverse::get_acs(state = "TN", geography = "school district (unified)", variables = "B19013_001") #median hh income
  6. sd_geo <- tigris::school_districts(state = "TN", type = "unified", class="sf")
  7. sd_joined <- dplyr::left_join(sd_geo, sd_income, by = "GEOID")
  8.  
  9. ggplot(sd_joined, aes(fill = estimate)) +
  10.   geom_sf() +
  11.   coord_sf(datum = NA) +
  12.   theme_minimal() +
  13.   scale_fill_distiller(palette = "Blues", direction = 1) +
  14.   labs(title = "School Districts",
  15.        fill = "Income",
  16.        caption = "data: US Census Burea ACS")
Add Comment
Please, Sign In to add comment