Take two intervals: [1,6) and [6,12). Number 6 belongs in the second but not the first. Can the same be accomplished in lubridate? (This deals with the issue in Python...)
library(lubridate)
date1 <- ymd(20010101); date3 <- ymd(20010103); date6 <- ymd(20010106); date12 <- ymd(20010112)
intA <- new_interval(date1, date6); intB <- new_interval(date6, date12)
date3 %within% intA
> TRUE
date3 %within% intB
> FALSE
date6 %within% intB ## I want this to be true
> TRUE
date6 %within% intA ## but this be false...
> TRUE
Can function %within% be tweaked to exclude upper bounds of intervals?
Any help will be much appreciated.