[R] is.na() == TRUE for POSIXlt time / date of "2014-03-09 02:00:00"

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Wed Jul 30 20:03:06 CEST 2014


Isn't that a timestamp that doesn't exist in standard US timezones? Maybe use a timezone that doesn't consider daylight savings (like "Etc/GMT+5")?
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On July 30, 2014 10:08:58 AM PDT, John McKown <john.archie.mckown at gmail.com> wrote:
>"I'm so confused!" Why does is.na() report TRUE for a POSIXlt date &
>time of 2014-03-09 02:00:00 ?
>
>> q
>[1] "2014-03-09 02:00:00"
>> is.na(q)
>[1] TRUE
>> as.POSIXct(q)
>[1] NA
>> dput(q)
>structure(list(sec = 0, min = 0L, hour = 2, mday = 9L, mon = 2L,
>    year = 114L, wday = 0L, yday = 67L, isdst = 0L, zone = "",
>    gmtoff = NA_integer_), .Names = c("sec", "min", "hour", "mday",
>"mon", "year", "wday", "yday", "isdst", "zone", "gmtoff"), class =
>c("POSIXlt",
>"POSIXt"))
>> str(q)
> POSIXlt[1:1], format: "2014-03-09 02:00:00"
>>



More information about the R-help mailing list