Apply cumsum in each row
Fast computation of t(apply(x,1,cumsum))
rowCumSum(x)
x |
A matrix. |
A matrix of same size as x.
Thomas Alexander Gerds <tag@biostat.ku.dk>
x <- matrix(1:8,ncol=2) rowCumSum(x)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.