pl_retally: Approximately re-tally Census data under new block boundaries

View source: R/pl_crosswalk.R

pl_retallyR Documentation

Approximately re-tally Census data under new block boundaries

Description

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.

Usage

pl_retally(d_from, crosswalk)

Arguments

d_from

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.

crosswalk

The crosswalk data frame, from pl_crosswalk()

Details

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.

Value

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().

Examples


crosswalk = pl_crosswalk("RI", 2010, 2020)
RI_2010 = pl_tidy_shp("RI", pl_url("RI", 2010), 2010)
pl_retally(RI_2010, crosswalk)



PL94171 documentation built on Sept. 12, 2022, 1:06 a.m.