[R] finite differences

David Winsemius dwinsemius at comcast.net
Fri Jun 27 02:35:45 CEST 2014

On Jun 26, 2014, at 3:03 AM, FV wrote:

> Hi
> I have a 2D array and I would like to compute finite differences in each
> dimension!
> Is there any function on R that computes that automatically.
> thanks in advance

It doesn't appear that there is a matrix method for diff but why not these:

t( apply(mat, 1, diff) )

apply(mat, 2, diff)

> 	[[alternative HTML version deleted]]

This is a plain text mailing list


David Winsemius
Alameda, CA, USA

More information about the R-help mailing list