Learn R Programming

incidence2 (version 2.2.3)

as.data.frame.incidence2: Convert incident object to a data frame

Description

Convert incident object to a data frame

Usage

# S3 method for incidence2
as.data.frame(x, row.names, optional, ...)

Arguments

x

<incidence2> object.

row.names

Not used.

optional

Not used.

...

Not used.

Examples

Run this code
data.table::setDTthreads(2)
dat <- data.frame(
    dates = Sys.Date() + 1:100,
    names = rep(c("Jo", "John"), 5)
)

dat <- incidence(dat, date_index = "dates", groups = "names")
as.data.frame(dat)

Run the code above in your browser using DataLab