grapes-during-grapes: Is a date covered by a grouped date

%during%R Documentation

Is a date covered by a grouped date

Description

⁠%during%⁠ determines whether a supplied date is within the period covered by each element of a grates object.

Usage

date %during% x

Arguments

date

A scalar ⁠<date>⁠ object.

x

grouped date vector.

Value

A logical vector indicating whether the date was present within the range of the tested object.

Examples


dates <- as.Date("2020-01-01") + 1:10
week <- as_isoweek(dates)
dates[1] %during% week

period <- as_period(dates, n = 3)
dates[10] %during% period


grates documentation built on April 3, 2025, 10:49 p.m.