# Not guaranteed to reach download from redistrict2020.org
if (FALSE) {
# download and read baf ----
url <- paste0('https://github.com/PlanScore/Redistrict2020/',
'raw/main/files/DE-2021-01/DE_SLDU_bef.zip')
tf <- tempfile('.zip')
utils::download.file(url, tf)
utils::unzip(tf, exdir = dirname(tf))
baf <- readr::read_csv(
file = paste0(dirname(tf), '/DE_SLDU_bef.csv'),
col_types = 'ci'
)
names(baf) <- c('GEOID', 'ssd_20')
# convert to vtd level ----
baf_to_vtd(baf = baf, plan_name = 'ssd_20', 'GEOID')
}
Run the code above in your browser using DataLab