Hi Lubridate folks.
I am using lubridate to work with a vector of intervals like this miniature example:
int1 <- new_interval(ymd_hms("2014-07-12 05:48:02"), ymd_hms("2014-07-13 05:48:02"))
int2 <- new_interval(ymd_hms("2014-07-12 10:48:02"), ymd_hms("2014-07-13 07:48:02"))
int3 <- new_interval(ymd_hms("2014-07-11 10:48:02"), ymd_hms("2014-07-12 01:48:02"))
ints <- c(int1, int2, int3)
I would like to determine whether any combination of two intervals in the vector overlap with each other. The int_overlaps() function does not seem to have a way to check all combinations. Is there a way to do this that I missed?
Or, in the absence of a way to do it within the int_overlaps() function, is there a way to vectorize this operation, so as to avoid the use of a for-loop? Ideally, I would like the results to be in the form of a matrix of TRUE or FALSE for each combination of intervals in the vector.