Re: [R] Difference across the Nth dimension of an array

2012-01-08 Thread Vincent Zoonekynd
On 9 January 2012 08:53, Phil Wiles wrote: > I have a multidimensional array - in this case with 4 dimensions of x,y,z > and time.  I'd like to take the time derivative of this matrix, i.e. > perform the diff operator along dimension number 4. "apply" can do that, but you may need to reorder the

[R] Difference across the Nth dimension of an array

2012-01-08 Thread Phil Wiles
I have a multidimensional array - in this case with 4 dimensions of x,y,z and time. I'd like to take the time derivative of this matrix, i.e. perform the diff operator along dimension number 4. In Matlab, there is a simple option to specify which dimension the difference is to be taken across., b