Skip to contents

Retrieve ACS reference counts for block groups, filtered by sample plan and study unit. Use to obtain population or household counts for weighting and expansion pipelines.

Usage

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

Arguments

settings

list. Must include:

  • acs_year — ACS year

  • acs_count_vars — count variable names

  • acs_dataset — ACS dataset name Modified by reference: no.

sample_plan_bg

character vector. Block group GEOIDs to include (length 12).

study_unit

character(1). 'household' or 'person'. Default: from settings.

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 — ACS reference count

  • sampled — 1 if in sample plan, else 0 Rows: one per block group. Keys: (bg_geoid).

Details

  • Determines ACS table and variable from settings and study unit.

  • Fetches ACS counts for specified year and dataset.

  • Filters block groups by sample plan; flags sampled groups.

  • 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.

See also

  • get_acs_bg_counts

  • fetch_acs

Other ACS utilities: get_acs_bg_counts(), 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_base(settings, sample_plan_bg, 'household')
#> Error in get_acs_bg_counts_base(settings, sample_plan_bg, "household"): could not find function "get_acs_bg_counts_base"
## End(Not run)