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

in_year(...)

in_isoyear(...)

in_epiyear(...)

Arguments

...

A numeric vector of years.

Value

A schedule object.

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.

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)
#> [1] TRUE FALSE FALSE FALSE FALSE FALSE
happen(in_year(2000, 2002), my_dates)
#> [1] TRUE FALSE TRUE FALSE FALSE FALSE
happen(in_year(2000:2002), my_dates)
#> [1] TRUE TRUE TRUE FALSE FALSE FALSE
happen(in_year(2000:2002, 2005), my_dates)
#> [1] TRUE TRUE TRUE FALSE FALSE TRUE
happen(in_isoyear(2004), my_dates)
#> [1] FALSE FALSE FALSE FALSE TRUE TRUE
head(schedule(in_year(2000), 20))
#> [1] "2000-01-01" "2000-01-02" "2000-01-03" "2000-01-04" "2000-01-05" #> [6] "2000-01-06"