[R] simple read in with zoo using POSIXlt

knavero knavero at gmail.com
Sun Apr 15 21:45:31 CEST 2012

Achim Zeileis-4 wrote
> I don't know why you make this so complicated. Either use
> read.zoo("test.txt", header = FALSE, sep = "\t",
>    format = "%d/%m/%Y %H:%M", tz = "")
> which yields a POSIXct time index. Alternatively, you can produce POSIXlt 
> via strptime:
> read.zoo("test.txt", header = FALSE, sep = "\t",
>    FUN = function(x) strptime(x, "%d/%m/%Y %H:%M"))
> The former is recommended for use in zoo.

Sorry, it's not that I'm trying to make it complicated, but rather specific.
As Gabor said in the earlier post, it seems POSIXlt is not a suitable
argument for read.zoo, and therefore explains the problem that I have been
having. Like I said, I was able to produce the solution that I wanted;
however, it was not as efficient and elegant as I was hoping it to be. When
going through 2 year span data sets, there is a noticeable difference in
speed when you use POSIXlt separately outside the read.zoo function. Anyway,
it's fine. I appreciate the feedback and suggestion. It definitely helps
bounce ideas around and possibly offers ways to expand R source code in the
future maybe. Thanks!

View this message in context: http://r.789695.n4.nabble.com/simple-read-in-with-zoo-using-POSIXlt-tp4557138p4559760.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list