[R] array question

Chang Shen Chang_Shen at progressive.com
Tue Jan 17 20:45:52 CET 2006

Hi all,

I want to create an array of datetime.

If I have a datetime object dt

>dt <- strptime("10Jan2006 00:00:15", "%d%b%Y %H:%M:%S")
[1]"2006-01-10 00:00:15"

I want to make an array of dt, say 100 size.  I got those error.

[1] "2006-01-10 00:00:15"
> dtarray<-array(dt, dim=c(100));
Error in array(dt, dim = c(100)) : dim<- : dims [product 100] do not match
the length of object [9]

> dtarray<-array(, dim=c(100));
> dtarray[1]<-dt;
Warning message:
number of items to replace is not a multiple of replacement length

Any help?


More information about the R-help mailing list