Skip to content

Instantly share code, notes, and snippets.

@arvi1000
Created November 6, 2020 19:21
Show Gist options
  • Save arvi1000/34d57f77bf7f56feb58eecf616ec251c to your computer and use it in GitHub Desktop.
Save arvi1000/34d57f77bf7f56feb58eecf616ec251c to your computer and use it in GitHub Desktop.
library(tidycensus)
library(tidyverse)
census_api_key(Sys.getenv('CENSUS_API_KEY'))
vars <- load_variables(2017, "acs5", cache = TRUE)
il <- get_acs(geography = "county",
variables = "B00001_001",
state = "IL", geometry = TRUE)
ggplot(il) +
geom_sf(aes(fill=estimate/1000), size=0.4, color='black') +
scale_fill_viridis_c() +
labs(title='Illinois Population By County',
subtitle = '2017 American Community Survey Estimate',
fill = 'Residents, 1000s') +
coord_sf(crs =sf::st_crs(26972), datum=NA) +
theme_void()
@arvi1000
Copy link
Author

arvi1000 commented Nov 6, 2020

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment