Skip to contents

join_acs_geography_ratio() uses data from get_acs_geographies() to support the calculation of proportions join parent column titles to a data frame of ACS data.

Usage

join_acs_geography_ratio(
  data,
  variable_col = "variable",
  value_col = "estimate",
  moe_col = "moe",
  geography = "county",
  na_matches = "never",
  digits = 2
)

Arguments

data

A data frame with column names matching the supplied parameters.

variable_col

Variable column name to join as join variable, Default: 'variable'

value_col, moe_col

Estimate and margin of error column names, Default: 'estimate' and 'moe'

geography

Value in geography column to use as comparison values, Default: 'county'

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’).

Value

A data frame with new estimate and moe columns prefixed with "ratio_".