Compute sum of values binned by a second variable

bySumFf(values, bins)

Arguments

values

An ff object containing the numeric values to take the sum of.

bins

An ff object containing the numeric values to bin by.

Examples

values <- ff::as.ff(c(1, 1, 2, 2, 1)) bins <- ff::as.ff(c(1, 1, 1, 2, 2)) bySumFf(values, bins)
#> bins sums #> 1 1 4 #> 2 2 3