View source: R/format_legacy_data.R
format_legacy_data | R Documentation |
format_legacy_data
formats legacy data from the U.S. census to allow
for Bayesian name geocoding.
format_legacy_data(legacyFilePath, state, outFile = NULL)
legacyFilePath |
A character vector giving the location of a legacy census data folder, sourced from https://www2.census.gov/programs-surveys/decennial/2020/data/01-Redistricting_File–PL_94-171/. These file names should end in ".pl". |
state |
The two letter state postal code. |
outFile |
Optional character vector determining whether the formatted RData object should be saved. The filepath should end in ".RData". |
This function allows users to construct datasets for analysis using the census legacy data format. These data are available for the 2020 census at https://www2.census.gov/programs-surveys/decennial/2020/data/01-Redistricting_File–PL_94-171/. This function returns data structured analogously to data from the Census API, which is not yet available for the 2020 Census as of September 2021.
## Not run:
gaCensusData <- format_legacy_data(PL94171::pl_url('GA', 2020))
predict_race_new(ga.voter.file, namesToUse = 'last, first, mid', census.geo = 'block',
census.data = gaCensusData)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.