block2prec_by_county {geomander} | R Documentation |
Aggregate Block Table by Matches and County
Description
Performs the same type of operation as block2prec, but subsets a precinct geometry based on a County fips column. This helps get around the problem that county geometries often have borders that follow rivers and lead to funny shaped blocks. This guarantees that every block is matched to a precinct which is in the same county.
Usage
block2prec_by_county(block_table, precinct, precinct_county_fips, epsg = 3857)
Arguments
block_table |
Required. Block table output from create_block_table |
precinct |
sf dataframe of shapefiles to match to. |
precinct_county_fips |
Column within precincts |
epsg |
numeric EPSG code to planarize to. Default is 3857. |
Value
dataframe with nrow(precinct) rows
Examples
## Not run:
# Need Census API
data(towns)
towns$fips <- '087'
block <- create_block_table('NY', 'Rockland')
block2prec_by_county(block, towns, 'fips')
## End(Not run)
[Package geomander version 2.3.0 Index]