Skip to contents

Retrieve ACS counts for block groups for one or more study units (household, person), joining results for weighting and expansion. Use to obtain both household and person counts for block groups in a single call.

Usage

get_acs_bg_counts(
  settings,
  sample_plan_bg,
  study_unit,
  year = NULL,
  dataset = NULL
)

Arguments

settings

list. See get_acs_bg_counts_base for required fields.

sample_plan_bg

character vector. Block group GEOIDs to include.

study_unit

character vector. 'household', 'person', or both.

year

integer(1). ACS year. Default: from settings.

dataset

character(1). ACS dataset ('acs1' or 'acs5'). Default: from settings.

Value

data.table with columns:

  • bg_geoid <character(12)> — block group GEOID

  • ref_count_h — household count (if requested)

  • ref_count_p — person count (if requested) Rows: one per block group. Keys: (bg_geoid).

Details

  • Calls get_acs_bg_counts_base for each study unit.

  • Joins results by block group GEOID, suffixing columns by unit.

  • Returns a copy; does not modify by reference.

  • Assumes block group GEOIDs are 12 characters; errors if not.

Settings

  • acs_year (direct): ACS year for reference counts. Default from settings.

  • acs_count_vars (direct): variable names for counts. Default from settings.

  • acs_dataset (direct): ACS dataset type. Default from settings.

  • acs_year (direct): ACS year for reference counts.

  • acs_count_vars (direct): variable names for counts.

  • acs_dataset (direct): ACS dataset type.

See also

  • get_acs_bg_counts_base

  • fetch_acs

get_acs_bg_counts_base, fetch_acs

Other ACS utilities: get_acs_bg_counts_base(), get_overlap_allocation(), get_puma_ids(), get_pumas(), get_tracts_puma_xwalk(), get_xwalk_sfx_to_sfy(), load_xwalk()

Examples

## Not run:
get_acs_bg_counts(settings, sample_plan_bg, c('household', 'person'))
#> Error: object 'settings' not found
## End(Not run)

## Not run:
get_acs_bg_counts(settings, sample_plan_bg, c('household', 'person'))
#> Error: object 'settings' not found