as | R Documentation |
Generic for coercion to an <incidence2>
object.
as_incidence(x, ...)
## Default S3 method:
as_incidence(x, ...)
## S3 method for class 'incidence2'
as_incidence(x, ...)
## S3 method for class 'incidence2'
as.data.frame(x, row.names, optional, ...)
## S3 method for class 'incidence2'
as.data.table(x, keep.rownames, ...)
## S3 method for class 'incidence2'
as_tibble(x, ..., .rows, .name_repair, rownames)
x |
An R object. |
... |
Additional arguments to be passed to or from other methods. |
row.names |
Not used. |
optional |
Not used. |
keep.rownames |
Not used. |
.rows |
The number of rows, useful to create a 0-column tibble or just as an additional check. |
.name_repair |
Treatment of problematic column names:
This argument is passed on as |
rownames |
How to treat existing row names of a data frame or matrix:
Read more in rownames. |
An object of the desired type with additional attributes dropped.
if (requireNamespace("outbreaks", quietly = TRUE)) {
data(ebola_sim_clean, package = "outbreaks")
dat <- ebola_sim_clean$linelist
x <- incidence(dat, "date_of_onset")
as.data.frame(dat)
as.data.table(x)
as_tibble(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.