Skip to contents

Determine the highest income bin for tabulation, using survey, ACS, and settings. Use to set upper bounds for income recoding and reporting.

Usage

get_max_income_bin(settings, value_labels = NULL, ignore_acs = FALSE)

Arguments

settings

list. Project settings; may include:

  • max_income_bin — explicit upper bound (optional)

  • acs_dataset — ACS dataset name (for ACS bin)

  • acs_year — ACS year (for ACS bin)

  • acs_tables — ACS table keys (for ACS bin) Modified by reference: no.

value_labels

data.table (optional). Survey value labels table. Must include:

  • variable — variable name

  • label — label text

  • value — bin value Keys: (variable, value).

ignore_acs

logical. If TRUE, ignores ACS codebook. Default FALSE.

Value

integer. Maximum income bin value used for tabulation.

Details

  • Compares max bins from survey codebook, ACS codebook, and settings.

  • Returns the lowest valid upper bound; errors if settings exceed codebooks.

  • Handles missing values and ignores ACS if requested.

  • Returns integer; does not modify by reference.

  • Assumes valid settings and codebooks; errors if missing.

Settings

  • max_income_bin (direct): explicit upper bound. Default NA.

  • acs_dataset (indirect via get_max_acs_income_bin): ACS dataset name.

  • acs_year (indirect via get_max_acs_income_bin): ACS year.

  • acs_tables (indirect via get_max_acs_income_bin): ACS table keys.

See also

  • get_max_survey_income_bin

  • get_max_acs_income_bin

Other recoding utilities: get_age_upper_bounds(), get_income_bounds(), get_max_acs_income_bin(), get_max_survey_income_bin()

Examples

## Not run:
get_max_income_bin(settings, value_labels)
#> Error: object 'settings' not found
## End(Not run)