sum_g: Compute per-group sums

Description Usage Arguments Value Examples

Description

Compute per-group sums

Usage

1
sum_g(col, first_indices, na.rm = FALSE)

Arguments

col

vector to sum

first_indices

numeric index of first index in each group

na.rm

locial if TRUE remove NAs

Value

per-group sum

Examples

1
2
3
v <- c(2, 3, 1, NA, 5)
fi <- c(1, 1, 3, 3, 3)
sum_g(v, fi)

WinVector/FastBaseR documentation built on May 21, 2019, 4:04 a.m.