Creates a schedule of events occurring in the months specified.
in_month(...)
... | A character or numeric vector of month elements. |
---|
A schedule object.
Months can be specified using their names (eg. "January"), abbreviations (eg. "Jan") or integers (eg. 1).
Multiple months can be specified in the same function call. For example:
in_month(1, 3)
produces a schedule of events occurring in January and
March. The same thing is achieved by in_month("Jan", "Mar")
.
Similarly in_month(1:3)
produces a schedule of events occurring in
January, February and March.
my_dates <- seq.Date(as.Date("2000-01-01"), as.Date("2000-04-01"), by = "1 month") happen(in_month("January"), my_dates)#> [1] TRUE FALSE FALSE FALSE#> [1] FALSE TRUE FALSE FALSE#> [1] FALSE FALSE TRUE FALSE#> [1] TRUE FALSE TRUE FALSE#> [1] TRUE TRUE TRUE FALSE## invalid inputs will produce an immediate error# NOT RUN { in_january <- in_month("Janu") in_january <- in_month(0) # }