
Hi Guys,

I'm cooking up my time series code. I want a data frame with first column as timestamp in POSIXlt format.

I hit on this the problem of how to create an array/list/vector of POSIXlt objects. Code is as follows



> dtt=array(dim = 2)
> t=as.POSIXlt( strptime("07/12/07 13:20:01", "%m/%d/%Y %H:%M:%S",tz="GMT"))
> dtt
[1] NA NA
> t
[1] "0007-07-12 13:20:01 GMT"
> dtt[1]=t
Warning message:
In dtt[1] = t :
  number of items to replace is not a multiple of replacement length
> class(dtt)
[1] "list"
> class(t)
[1] "POSIXt"  "POSIXlt"
> unclass(t)
$sec
[1] 1

$min
[1] 20

$hour
[1] 13

$mday
[1] 12

$mon
[1] 6

$year
[1] -1893

$wday
[1] 4

$yday
[1] 192

$isdst
[1] 0

attr(,"tzone")
[1] "GMT"



Seems like POSIXlt is matrix in this case. 

Any suggestions?

Cheers,

B
_________________________________________________________________
[[elided Hotmail spam]]

	[[alternative HTML version deleted]]

