in_week | R Documentation |
Creates a schedule of events occurring in the weeks specified.
in_week(...)
in_isoweek(...)
in_epiweek(...)
... |
a numeric vector of weeks. |
The type of week is determined by the function used. These week types are
built atop their definitions in the lubridate
package, which are quoted here:
week()
returns the number of complete seven day periods that have
occurred between the date and January 1st, plus one.
isoweek()
returns the week as it would appear in the ISO 8601
system, which uses a reoccurring leap week.
epiweek()
is the US CDC version of epidemiological week. It
follows same rules as isoweek()
but starts on Sunday. In other parts of
the world the convention is to start epidemiological weeks on Monday,
which is the same as isoweek.
A schedule object.
my_dates <- seq.Date(from = as.Date("2000-01-01"),
to = as.Date("2000-02-01"),
by = "1 week")
happen(in_week(1), my_dates)
happen(in_week(1, 3), my_dates)
happen(in_week(1:3), my_dates)
happen(in_isoweek(1), my_dates)
## invalid inputs will produce an immediate error:
## Not run:
in_week(0)
in_week(54)
in_week(1.5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.