R/pl_crosswalk.R
pl_retally.Rd
Applies a block crosswalk to a table of block data using areal interpolation. That is, the fraction of land area in the overlapping region between old and new blocks is used to divide the population of the old blocks into the new.
pl_retally(d_from, crosswalk)
The data frame to process. All numeric columns will be re-tallied. Integer columns will be re-tallied with rounding. Character columns will be preserved if constant across new block geometries.
The crosswalk data frame, from pl_crosswalk()
A new data frame, like d_from
, except with the geometry column
dropped, if one exists. New geometry should be loaded, perhaps with
tinytiger::tt_blocks()
.
All numeric columns will be re-tallied. Integer columns will be re-tallied with rounding. Character columns will be preserved if constant across new block geometries.
Blocks from other states will be ignored.
# \donttest{
crosswalk = pl_crosswalk("RI", 2010, 2020)
#> Download did not succeed. Try again.
RI_2010 = pl_tidy_shp("RI", pl_url("RI", 2010), 2010)
#> Error in curl::curl_download(url, path, quiet = quiet): HTTP response code said error [www2.census.gov]: The requested URL returned error: 403
pl_retally(RI_2010, crosswalk)
#> Error: object 'RI_2010' not found
# }