start=as.Date(\"2013-09-02\")
x[1:140]<-start
for(i in 2:140){
x[i]<-x[i-1]+1 }
what i get is something as such:
[1] \"2013
That's just a weird behaviour of matrix
. Dates are internally stored as an integer of the number of days since 1st Jan 1970. Those are the numbers that you are seeing.
Probably the best option is to store them in a data frame instead.
FYI, you can create a sequence of dates using seq
.
x <- seq(as.Date("2013-09-02"), length.out = 140, by = "1 day")