So I have been trouble with creating a counter, hopefully you all will be able to help. Lets say I have a vector
x <- c(40,10,60)
The desired output would be a new matrix 3 x n each row being a new date looking something like this..
40 39 38 37 36 35 34 33 32 31 30...
10 9 8 7 6 5 4 3 2 1 0 0 0
60 59 58 57 56 55 54 53 52 51 50
What I want is for the row to subtract one from the previous entry an n number of times. How would I go about doing this?
Any help is much appreciated.