[R] vector of dates
Barbara.Rogo at uniroma1.it
Barbara.Rogo at uniroma1.it
Thu Jul 7 15:35:54 CEST 2011
I have to construct a vector of date with a cycle "for". I use the function
"seq", but when I allocate in a vector, this becomes a number!!!
How do I have? thank you
Example:
dataval=as.Date("2011/07/01")
date_val=seq(dataval,length=260,by="-7 day")
date_inizio=c()
date_condizione=c()
for (k in 1:length(date_val)){
date_inizio[k]=seq(date_val[k],length=2,by="-5 years")[2]
date_condizione[k]=seq(date_val[k],length=2,by="-2 years")[2]
}
More information about the R-help
mailing list