Skip to content

Instantly share code, notes, and snippets.

@walkerke
Created July 14, 2022 13:23
Show Gist options
  • Save walkerke/1e490c2033771461600c7c40ddc02d38 to your computer and use it in GitHub Desktop.
Save walkerke/1e490c2033771461600c7c40ddc02d38 to your computer and use it in GitHub Desktop.
# remotes::install_github("walkerke/tidycensus")
library(tidycensus)
# census_api_key("your key here")
tarrant00 <- get_decennial(
geography = "tract",
variables = "DP2_C29",
state = "TX",
county = "Tarrant",
year = 2000,
sumfile = "sf3profile",
geometry = TRUE
)
m1 <- mapview::mapview(tarrant00, zcol = "value",
layer.name = "% with college<br/>degree, 2000",
at = seq(0, 100, 20))
tarrant20 <- get_acs(
geography = "tract",
variables = "DP02_0068P",
state = "TX",
county = "Tarrant",
year = 2020,
geometry = TRUE
)
m2 <- mapview::mapview(tarrant20, zcol = "estimate",
layer.name = "% with college<br/>degree, 2016-2020",
at = seq(0, 100, 20))
leafsync::sync(m1, m2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment