split.incidence2 {incidence2} | R Documentation |
Divide an incidence2 object in to it's implicit groupings
Description
Split divides and incidence2 object in to it's underlying groupings (count variable and optionally groups).
Usage
## S3 method for class 'incidence2'
split(x, f, drop, ...)
Arguments
x |
An incidence2 object. |
f |
Not used. Present only for generic compatibility. |
drop |
Not used. Present only for generic compatibility. |
... |
Not used. Present only for generic compatibility. |
Value
A list of tibbles contained the split data. This list also has a "key" attribute which is a tibble with rows corresponding to the grouping of each split.
See Also
vctrs::vec_split()
on which split.incidence2()
is built.
Examples
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") |>
split()
}
[Package incidence2 version 2.3.1 Index]