powered by
bySum works like a very fast version of tapply with (weighted) FUN=sum.
bySum
FUN=sum
bySum(x, by, na.rm = FALSE, weight = NULL, ...)
numeric vector to be summed
numeric
(list of) factor(s) for which the sum will be calculated
factor(s)
logical If TRUE NA values will be removed
logical
TRUE
NA
numeric with of same length as x
x
not used
array with dimensions of by
array
by
# NOT RUN { bySum(warpbreaks$breaks, warpbreaks$wool) bySum(warpbreaks$breaks, warpbreaks[,-1]) # }
Run the code above in your browser using DataLab