if (FALSE) {
# Example: interpolating work-from-home from 2011-2015 ACS
# to 2020 shapes
library(tidycensus)
library(tidyverse)
library(tigris)
options(tigris_use_cache = TRUE)
wfh_15 <- get_acs(
geography = "tract",
variables = "B08006_017",
year = 2015,
state = "AZ",
county = "Maricopa",
geometry = TRUE
) %>%
select(estimate)
wfh_20 <- get_acs(
geography = "tract",
variables = "B08006_017",
year = 2020,
state = "AZ",
county = "Maricopa",
geometry = TRUE
)
maricopa_blocks <- blocks(
"AZ",
"Maricopa",
year = 2020
)
wfh_15_to_20 <- interpolate_pw(
from = wfh_15,
to = wfh_20,
to_id = "GEOID",
weights = maricopa_blocks,
weight_column = "POP20",
crs = 26949,
extensive = TRUE
)
}
Run the code above in your browser using DataLab