tally | R Documentation |
Helper function to aggregate a vector by district. Can be used to calculate total population, group percentages, and more.
tally(plans, shp, x)
plans |
A |
shp |
A |
x |
The numeric vector to tally. |
A numeric vector with the tallies. Can be shaped into a district-by-plan matrix.
data(nh)
data(nh_m)
tally(nh_m, nh, pop) # total population
tally(nh_m, nh, vap_hisp) / tally(nh_m, nh, vap) # HVAP
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.