nielshintzen/vmstools

1801 is not a leap year

Closed this issue · 1 comments

in the descrambling of the tacsat data (year shift in dates) consideration of leap year was likely ignored.

in the date column one has "29/02/1801". since 1801 was not a leap year the following returns NA's for that date:

library(vmstools)
data(tacsat)
tacsat$SI_DATIM <- as.POSIXct(paste(tacsat$SI_DATE,tacsat$SI_TIME,sep=" "), 
                              tz="GMT", format="%d/%m/%Y  %H:%M")
i <- is.na(tacsat$SI_DATIM)
tacsat[i, "SI_DATE"]

years in the vicinity of 1800 that are leap years are easily found using the lubridate::leap_year package. e.g.:

lubridate::leap_year(1795:1805)

regards,
einar

It is one of the first questions we put to students in the VMStools course on day 1 to figure out what it causing this :-). We are aware it is a leap year, but since it's a training dataset, I'm not too worried about it.