int_aligns

0th

Percentile

Test if two intervals share an endpoint

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.

Usage
int_aligns(int1, int2)
Arguments
int1
an Interval object
int2
an Interval object
Value

  • Logical. TRUE if int1 and int2 begin or end on the same moment. FALSE otherwise.

Aliases
  • int_aligns
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-01-01"))
# 2001-06-01 UTC--2002-01-01 UTC
int3 <- new_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
Documentation reproduced from package lubridate, version 1.3.0, License: GPL

Community examples

Looks like there are no examples yet.