[R] simple read in with zoo using POSIXlt

Gabor Grothendieck ggrothendieck at gmail.com
Mon Apr 16 05:33:25 CEST 2012


On Sun, Apr 15, 2012 at 3:45 PM, knavero <knavero at gmail.com> wrote:
>
> 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

Its not just zoo -- its not suitable for use as a column in a data
frame or for time series in general.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list