%within%

0th

Percentile

Tests whether a date or interval falls within an interval

If a is an interval, both its start and end dates must fall within b to return TRUE.

Usage
a %within% b
Arguments
a
An interval or date-time object
b
An interval
Value

A logical

Aliases
  • %within%
  • %within%,ANY,Interval-method
  • %within%,Interval,Interval-method
Examples
int <- 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

ymd("2001-05-03") %within% int # TRUE
int2 %within% int # TRUE
ymd("1999-01-01") %within% int # FALSE
Documentation reproduced from package lubridate, version 1.5.6, License: GPL-2

Community examples

Looks like there are no examples yet.