Skip to content

Instantly share code, notes, and snippets.

@fototo
Forked from walkerke/county_subdivisions.R
Created August 25, 2018 15:45
Show Gist options
  • Save fototo/545db5340359a2a92f68d5d50336e4f1 to your computer and use it in GitHub Desktop.
Save fototo/545db5340359a2a92f68d5d50336e4f1 to your computer and use it in GitHub Desktop.
library(tigris)
library(tidycensus)
library(tidyverse)
library(sf)
ma_income <- get_acs(geography = "county subdivision",
variables = "B19013_001",
state = "MA")
ma_subs <- county_subdivisions(state = "MA", cb = TRUE, class = "sf") %>%
select(GEOID)
ma_joined <- left_join(ma_subs, ma_income, by = "GEOID")
plot(ma_joined["estimate"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment