-
Notifications
You must be signed in to change notification settings - Fork 213
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
library(lubridate)
start <- c("2016-04-29 12:00:00 GMT", "2013-10-31 12:00:00 GMT", "2012-05-31 12:00:00 GMT", "2010-06-29 12:00:00 GMT",
"2014-12-31 12:00:00 GMT", "2015-08-31 12:00:00 GMT", "2013-03-29 12:00:00 GMT", "2014-07-31 12:00:00 GMT")
end <- c("2017-03-25", "2014-03-16", "2012-12-15", "2011-03-25", "2015-10-16" ,"2016-03-16", "2014-03-28" ,"2015-07-22")
mt <- as.POSIXlt(start)
int <- interval(start, end)
id <- int %/% months(1)
int %% months(1)
## [1] NA--NA NA--NA NA--NA NA--NA NA--NA NA--NA NA--NA NA--NA
mt + months(id)
## [1] NA NA NA NA NA NA NA NA
lubridate:::add_months(mt, id)
## [1] NA NA NA NA NA NA NA NA
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior