nest.incidence2 | R Documentation |
Method for tidyr::nest that implicitly accounts for the inherent grouping structure of incidence2 objects.
## S3 method for class 'incidence2'
nest(.data, ..., .by, .key, .names_sep)
.data |
An incidence2 object. |
... |
Not used. |
.by |
Not used. |
.key |
The name of the resulting nested column. Only applicable when
If |
.names_sep |
Not used. |
A nested tibble with rows corresponding to the count variable and (optionally) group columns of the input object.
tidyr::nest for the underlying generic.
if (requireNamespace("outbreaks", quietly = TRUE)) {
data(ebola_sim_clean, package = "outbreaks")
ebola_sim_clean$linelist |>
subset(!is.na(hospital)) |>
incidence_(date_of_onset, hospital, interval = "isoweek") |>
nest()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.