Dear list,

Don't you think it could be useful to have in R base a function  
rowCumSums, that compute cumulative sums for each row of a matrix?

My implementation of rowCumSums is

rowCumSums <- function(x) t(mapply(function(row)cumsum(x[row,]),  
1:NROW(x)))

I'm sure it can be improved to have other arguments like na.rm or dims.

Is there any hope to have this function in R?

Christophe

--
Christophe Dutang
Ph.D. student at ISFA, Lyon, France
website: http://dutangc.free.fr







        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to