I'm using lubridate
to perform several operations on dates, and at some point I need to add 6 days to date I'm working with. I'm doind this in a loop and it works for almost every date, but on this specific one the sum returns NA
library(lubridate)
testDate <- ymd("2018-10-29", tz = "America/Sao_Paulo")
testDate + days(4) #OK
testDate + days(5) #OK
testDate + days(6) #Returns NA
testDate + days(7) #OK
testDate + days(8) #OK
testDate + days(9) #OK
Can someone help me understand why is this happening?
Session Info:
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.7.4
loaded via a namespace (and not attached):
[1] compiler_3.6.0 magrittr_1.5 tools_3.6.0 Rcpp_1.0.3 stringi_1.4.3 stringr_1.4.0