Using rowDiffs() to calculate difference in values in matrix

Posted by user1723765 on Stack Overflow See other posts from Stack Overflow or by user1723765
Published on 2012-11-13T10:58:33Z Indexed on 2012/11/13 10:59 UTC
Read the original article Hit count: 122

Filed under:

I'm using the rowDiffs() command to calculate the step by step difference in 116 rows in a matrix.

I get the following error:

Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : 
non-numeric argument to binary operator

I have no idea why this is happening. I could take the diff() separately for each row and it would work.

Any ideas?

Here's the data:

https://dl.dropbox.com/u/22681355/data.csv

Code:

a=rowDiffs(data)

© Stack Overflow or respective owner

Related posts about r