set_tags | R Documentation |
This function changes the tags
of a linelist
object, using the same
syntax as the constructor make_linelist()
. If some of the default tags are
missing, they will be added to the final object.
set_tags(x, ..., allow_extra = FALSE)
x |
a |
... |
< |
allow_extra |
a |
The function returns a linelist
object.
make_linelist()
to create a linelist
object
if (require(outbreaks)) {
## create a linelist
x <- make_linelist(measles_hagelloch_1861, date_onset = "date_of_rash")
tags(x)
## add new tags and fix an existing one
x <- set_tags(x,
age = "age",
gender = "gender",
date_onset = "date_of_prodrome"
)
tags(x)
## add non-default tags using allow_extra
x <- set_tags(x, severe = "complications", allow_extra = TRUE)
tags(x)
## remove tags by setting them to NULL
old_tags <- tags(x)
x <- set_tags(x, age = NULL, gender = NULL)
tags(x)
## setting tags providing a list (used to restore old tags here)
x <- set_tags(x, !!!old_tags)
tags(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.