[R] cumsum in 3d arrays

Ben Bolker bbolker at gmail.com
Sat Nov 26 17:15:24 CET 2011


zloncaric <zloncaric <at> biologija.unios.hr> writes:

> Is it posible to apply /cumsum()/ along the 3rd dimension of 3D array? 
> Something like matrlab function - /cumsum (*A*,dim)/ which returns the
> cumulative sum of the elements along the dimension of *A* specified by
> scalar dim.

  Check out the combination of apply and cumsum.



More information about the R-help mailing list