Skip to contents

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 two NaN values match?

  • "na", the default, treats two NA or two NaN values as equal, like %in%, match(), and merge().

  • "never" treats two NA or two NaN values as different, and will never match them together or to any other values. This is similar to joins for database sources and to base::merge(incomparables = NA).

digits

integer indicating the number of decimal places (round) or significant digits (signif) to be used. For round, negative values are allowed (see ‘Details’).