igroupSums {Rigroup} | R Documentation |
This function allows a user to quickly calculate the sums for each small integer group of a data vector .
igroupSums(x,i,na.rm=TRUE)
x |
A numeric, integer, or logical data vector |
i |
A small integer vector indicating group membership 1:ngroups |
na.rm |
if TRUE remove NAs before use (defaults to TRUE) |
This package provides a fast implementation for calculating sums for each group in a data vector where a small integer vector (1:number of groups) indicates group membership. na.rm is used to determine how NAs are handled. The return value is a vector with length(number of groups).
igroupSums: Returns an vector with length equal to the number of groups.
K. Hendricks with lots of help from B. Dunlap
None
igroupAlls
igroupAnys
igroupCounts
igroupMaxs
igroupMeans
igroupMins
igroupProds
igroupRanges
x <- rnorm(100) i <- rep(1:25,4) sums <- igroupSums(x,i) sums