int_overlaps
From lubridate v1.1.0
by Garrett Grolemund
Test if two intervals overlap
Test if two intervals overlap
Usage
int_overlaps(int1, int2)
Arguments
- int1
- an Interval object
- int2
- an Interval object
Value
- Logical. TRUE if int1 and int2 overlap by at least one second. FALSE otherwise.
Examples
int1 <- new_interval(ymd("2001-01-01"), ymd("2002-01-01"))
# 2001-01-01 UTC--2002-01-01 UTC
int2 <- new_interval(ymd("2001-06-01"), ymd("2002-06-01"))
# 2001-06-01 UTC--2002-06-01 UTC
int3 <- new_interval(ymd("2003-01-01"), ymd("2004-01-01"))
# 2003-01-01 UTC--2004-01-01 UTC
int_overlaps(int1, int2) # TRUE
int_overlaps(int1, int3) # FALSE
Community examples
Looks like there are no examples yet.