Using rowDiffs() to calculate difference in values in matrix
- by user1723765
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)