Adds the GEOID identifier common to spatial census data sets, such as those loaded by tigris. This allows for easier merging or aggregation by a single variable.
add_geoid(
ppmf,
state = TABBLKST,
county = TABBLKCOU,
tract = TABTRACT,
block_group = TABBLKGRP,
block = TABBLK,
level = "block"
)
tibble of ppmf data
Column in ppmf with state (fips) ID. Default is TABBLKST
.
Column in ppmf with county (fips) ID. Default is TABBLKCOU
.
Column in ppmf with tract ID. Default is TABBLKTRACT
.
Column in ppmf with block group ID. Default is TABBLKGRP
Column in ppmf with block ID. Default is TABBLK
.
Geographic level to write the GEOID for. Options are block (default), block_group, tract, and county.
input data ppmf with added column GEOID
data(ppmf_ex)
ppmf_ex <- ppmf_ex |> add_geoid()