| windows | R Documentation |
Covert windows to and from case_lengths and recurrence_lengths.
epid_windows(date, lengths, episode_unit = "days")
epid_lengths(date, windows, episode_unit = "days")
index_window(date, from_last = FALSE)
date |
As used in |
lengths |
The duration ( |
episode_unit |
Time unit of |
windows |
The range ( |
from_last |
As used in |
epid_windows - returns the corresponding window for a given a date, and case_length or recurrence_length.
epid_lengths - returns the corresponding case_length or recurrence_length for a given date and window.
index_window - returns the corresponding case_length or recurrence_length for the date only.
index_window(date = x) is a convenience function for epid_lengths(date = x, window = x).
number_line.
# Which `window` will a given `length` cover?
date <- Sys.Date()
epid_windows(date, 10)
epid_windows(date, number_line(5, 10))
epid_windows(date, number_line(-5, 10))
epid_windows(date, -5)
# Which `length` is required to cover a given `window`?
date <- number_line(Sys.Date(), Sys.Date() + 20)
epid_lengths(date, Sys.Date() + 30)
epid_lengths(date, number_line(Sys.Date() + 25, Sys.Date() + 30))
epid_lengths(date, number_line(Sys.Date() - 10, Sys.Date() + 30))
epid_lengths(date, Sys.Date() - 10)
# Which `length` is required to cover the `date`?
index_window(20)
index_window(number_line(15, 20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.