int_aligns {lubridate} | R Documentation |
int_aligns tests for the case where two intervals begin or end at the same moment when arranged chronologically. The direction of each interval is ignored. int_align tests whether the earliest or latest moments of each interval occur at the same time.
int_aligns(int1, int2)
int1 |
an Interval object |
int2 |
an Interval object |
Logical. TRUE if int1 and int2 begin or end on the same moment. FALSE otherwise.
int1 <- interval(ymd("2001-01-01"), ymd("2002-01-01")) # 2001-01-01 UTC--2002-01-01 UTC int2 <- interval(ymd("2001-06-01"), ymd("2002-01-01")) # 2001-06-01 UTC--2002-01-01 UTC int3 <- interval(ymd("2003-01-01"), ymd("2004-01-01")) # 2003-01-01 UTC--2004-01-01 UTC int_aligns(int1, int2) # TRUE int_aligns(int1, int3) # FALSE