in_year: Specify the year(s) of a schedule

View source: R/year.R

in_yearR Documentation

Specify the year(s) of a schedule

Description

Creates a schedule of events occurring in the year(s) specified.

Usage

in_year(...)

in_isoyear(...)

in_epiyear(...)

Arguments

...

A numeric vector of years.

Details

The type of year is determined by the function used. These year types are built atop their definitions in the lubridate package, where year() is the commonly understood definition of a year. The other definitions from the lubridate package are quoted here:

  • isoyear() returns years according to the ISO 8601 week calendar.

  • epiyear() returns years according to the epidemilogical week calendars.

Value

A schedule object.

Examples

my_dates <- seq(from = as.Date("2000-01-01"),
                to = as.Date("2005-01-01"),
                by = "1 year")

happen(in_year(2000), my_dates)

happen(in_year(2000, 2002), my_dates)

happen(in_year(2000:2002), my_dates)

happen(in_year(2000:2002, 2005), my_dates)

happen(in_isoyear(2004), my_dates)

head(schedule(in_year(2000), 20))

jameslairdsmith/gs documentation built on July 19, 2023, 12:49 a.m.