bdill icon

missing_school_districts_shapefile.R

bdill | PRO | 06/04/22 10:16:39 PM UTC (Edited) | 0 ⭐ | 877 👁️ | Never ⏰ | []
R |

590 B

|

None

|

0 👍

/

0 👎

library(tigris)
library(tidycensus)
library(tidyverse)
 
sd_income <- tidyverse::get_acs(state = "TN", geography = "school district (unified)", variables = "B19013_001") #median hh income
sd_geo <- tigris::school_districts(state = "TN", type = "unified", class="sf")
sd_joined <- dplyr::left_join(sd_geo, sd_income, by = "GEOID")
 
ggplot(sd_joined, aes(fill = estimate)) +
  geom_sf() +
  coord_sf(datum = NA) +
  theme_minimal() +
  scale_fill_distiller(palette = "Blues", direction = 1) +
  labs(title = "School Districts",
       fill = "Income",
       caption = "data: US Census Burea ACS")

Comments