in_month | R Documentation |
Creates a schedule of events occurring in the months specified.
in_month(...)
... |
A character or numeric vector of month elements. |
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.
A schedule object.
my_dates <- seq.Date(as.Date("2000-01-01"),
as.Date("2000-04-01"),
by = "1 month")
happen(in_month("January"), my_dates)
happen(in_month("Feb"), my_dates)
happen(in_month(3), my_dates)
happen(in_month("Jan", "Mar"), my_dates)
happen(in_month(1:3), my_dates)
## invalid inputs will produce an immediate error
## Not run:
in_january <- in_month("Janu")
in_january <- in_month(0)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.