Variant of block2prec() that matches blocks to precincts separately within
each county. This helps avoid cross-county mismatches when county boundaries
and census blocks do not line up cleanly.
Arguments
- block_table
Block table, usually from
create_block_table().- precinct
sfobject of target precinct shapes.- precinct_county_fips
Name of the county identifier column in
precinct.- epsg
numeric EPSG code to planarize to. Default is 3857.
Examples
if (FALSE) { # \dontrun{
# Need Census API
data(towns)
towns$fips <- '087'
block <- create_block_table('NY', 'Rockland')
block2prec_by_county(block, towns, 'fips')
} # }
