tally {redistmetrics} | R Documentation |
Tally a Column by District
Description
Helper function to aggregate a vector by district. Can be used to calculate total population, group percentages, and more.
Usage
tally(plans, shp, x)
Arguments
plans |
A |
shp |
A |
x |
The numeric vector to tally. |
Value
A numeric vector with the tallies. Can be shaped into a district-by-plan matrix.
Examples
data(nh)
data(nh_m)
tally(nh_m, nh, pop) # total population
tally(nh_m, nh, vap_hisp) / tally(nh_m, nh, vap) # HVAP
[Package redistmetrics version 1.0.7 Index]