While converting a vector of date-time to POSIXlt, just one particular time "25-Mar-1984-02:00" "is converted to POSIXlt but returns NA! So, this row was getting omitted in my analysis/plots.
is.na(as.POSIXlt("25-Mar-1984-02:00",format = "%d-%b-%Y-%H:%M"))
is.na(as.POSIXlt("25-Mar-1984-03:00",format = "%d-%b-%Y-%H:%M"))
is.na(as.POSIXlt("25-Mar-1984-01:00",format = "%d-%b-%Y-%H:%M"))
is.na(as.POSIXlt("24-Mar-1984-02:00",format = "%d-%b-%Y-%H:%M"))
is.na(as.POSIXlt("26-Mar-1984-02:00",format = "%d-%b-%Y-%H:%M"))
returns TRUE, FALSE, FALSE, FALSE, FALSE.
but
class(as.POSIXlt("25-Mar-1984-02:00",format = "%d-%b-%Y-%H:%M"))
returns
[1] "POSIXlt" "POSIXt"
Isn't that strange? How can I get it to be "not NA"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…