split.incidence2: Divide an incidence2 object in to it's implicit groupings

View source: R/split.R

split.incidence2R 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()
}



incidence2 documentation built on Oct. 7, 2024, 1:07 a.m.