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

Description Usage Arguments Details Value Examples

View source: R/pl_crosswalk.R

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

1
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 tigris::blocks().

Examples

1
2
3
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 Nov. 19, 2021, 1:07 a.m.