R/aggsum.R

Defines functions aggsum

Documented in aggsum

aggsum <- function(x,reverse=FALSE){
    n = length(x)
    if(n>1){
        if(reverse==FALSE){y=.C("AggSum",as.integer(n), x = as.double(x))$x} else
        {y =rev(x); y=.C("AggSum",as.integer(n), x = as.double(y))$x; y = rev(y)}
    }
    return(y)
}

Try the scar package in your browser

Any scripts or data that you put into this service are public.

scar documentation built on May 28, 2022, 1:22 a.m.