[R] manipulating a matrix

2010-05-12 Thread Clark Johnston
Is there a way to create a new matrix from and existing matrix with A [,1] [,2] [1,] 113 [2.] 218 [3,] 314 [4,] 420 if(A[,2] > 15) B [,1] [,2] [1,] 2 18 [2,] 4 20 -- View this message in context:

[R] difference along a vector

2010-05-12 Thread Clark Johnston
I was looking for a function which would take the difference along a vector? >a<-c(1,12,23,44,15,28,7,8,9,10) if I set the number difference to 3 would return 43 2 5 -37 -7 -19 3 or do I need to write my own function for this. -- View this message in context: http://r.789695.n4.nabble.com/diff