I have a matrix with the following values: a <- c(4,6,7,78,3,2,5,6,7,8)
I would like to create a second matrix b which lists the changes in a‘s value at each step.
So the solution would be: b <- c(2,1,71,-75,-1,3,1,1,1)
Is there a function for this in R and if there isn’t what is the easiest way to proceed?
1 Answer