Skip to contents

Get the identifier of the closest census block group based on the intersection of the s2 cell locations with the the US Census TIGER/Line shapefiles

Usage

s2_join_tiger_bg(x, year = as.character(2024:2013))

Arguments

x

s2_cell vector

year

vintage of TIGER/Line block group geography files

Value

character vector of matched census block group identifiers

Details

TIGER geography files are saved to the R user cache directory for the addr package. This allows R sessions to reuse previously downloaded files. See ?tools::R_user_dir() to change where TIGER geography files are saved.

Examples

s2_join_tiger_bg(x = s2::as_s2_cell(c("8841b39a7c46e25f", "8841a45555555555")))
#> [1] "390610032001" "210370519034"