[R-SIG-Finance] xts NA date for

Dan Potter arsanalytica at gmail.com
Fri Sep 23 13:51:34 CEST 2011


Hello All,
I am new to R and having an issue with xts when I try and used it with
certain dates and times in 1987.

Example

> # This date and time works
> xts(1, order.by = strptime("04/05/87 12:00",format="%m/%d/%y %H:%M"))
[,1]
1987-04-05 12:00:00 1

# This date and time do not work
> xts(1, order.by = strptime("04/05/87 2:00",format="%m/%d/%y %H:%M"))
[,1]
<NA> 1

I don't think the issue is with strptime since it seems to work fine
on the offending date and time, i.e.
> strptime("04/05/87 02:00",format="%m/%d/%y %H:%M")
[1] "1987-04-05 02:00:00"

Any suggestion or work arounds would be appreciated.

Thanks,
Dan



More information about the R-SIG-Finance mailing list