pl_select_standard {PL94171} | R Documentation |
Select the Standard Redistricting Columns
Description
Selects the standard set of basic population groups and VAP groups. Optionally renames them from the PXXXYYYY naming convention (where XXX is the table and YYYY is the variable) to more human readable names. pop_* is the total population, from tables 1 and 2, while vap_* is the 18+ population (voting age population).
Usage
pl_select_standard(pl, clean_names = TRUE)
Arguments
pl |
A list of PL tables, as read in by |
clean_names |
whether to clean names |
Details
If clean names=TRUE
, then the variables extracted are as follows:
-
\*_hisp
: Hispanic or Latino (of any race) -
\*_white
: White alone, not Hispanic or Latino -
\*_black
: Black or African American alone, not Hispanic or Latino -
\*_aian
: American Indian and Alaska Native alone, not Hispanic or Latino -
\*_asian
: Asian alone, not Hispanic or Latino -
\*_nhpi
: Native Hawaiian and Other Pacific Islander alone, not Hispanic or Latino -
\*_other
: Some Other Race alone, not Hispanic or Latino -
\*_two
: Population of two or more races, not Hispanic or Latino
where \* is pop
or vap
.
Value
A tibble with the selected and optionally renamed columns
Examples
pl_ex_path <- system.file('extdata/ri2018_2020Style.pl', package = 'PL94171')
pl <- pl_read(pl_ex_path)
pl <- pl_select_standard(pl)