rollup.pct: Calculate a/b for each Subset

View source: R/rollup.pct.R

rollup.pctR Documentation

Calculate a/b for each Subset

Description

Uses data.table package to quickly calculate ratio of a/b within each subset of a dataset (e.g., by zone). This will be superseded by rollup() once that is completed.

Usage

rollup.pct(a, b, zone)

Arguments

a

Required numeric vector, numerator

b

Required numeric vector, denominator. Same length as a.

zone

Optional, vector to group by. Same length as a and b.

Value

Returns a table with a/b calculated within each zone.

See Also

make.bin.pctile.cols() and assign.pctiles()

Examples

  pre1960=1:100; builtunits=rep(c(10, 100),50); zone=rep(c('NY','MA'),50)
  rollup.pct(a,b,zone)

ejanalysis/ejanalysis documentation built on April 2, 2024, 10:12 a.m.