Join percent estimates to ACS data based on denominator values
Source:R/join_acs.R
join_acs_percent.Rd
join_acs_percent()
uses the denominator_column_id value from the column
metadata added with label_acs_metadata()
to calculate the estimate as a
percent share of the denominator value. tidycensus::moe_prop()
is used to
calculate the margin of error for the percentage.
Usage
join_acs_percent(
data,
geoid_col = "GEOID",
column_id_col = "column_id",
denominator_col = "denominator_column_id",
na_matches = "never",
digits = 2
)
Arguments
- data
A data frame with column names including "column_id", "column_title", "denominator_column_id", "estimate", and "moe".
- geoid_col
A GeoID column name to use if perc is
TRUE
, Defaults to 'GEOID'.- column_id_col
Column ID column name from Census Reporter metadata. Defaults to "column_id"
- denominator_col
Denominator column ID name from Census Reporter metadata. Defaults to "denominator_column_id"
- na_matches
Should two
NA
or twoNaN
values match?- digits
integer indicating the number of decimal places (
round
) or significant digits (signif
) to be used. Forround
, negative values are allowed (see ‘Details’).