Skip to contents

This function returns a data.frame of all the tagged variables stored in a linelist. Note that the output is no longer a linelist, but a regular data.frame.

Usage

tags_df(x)

Arguments

x

a linelist object

Value

A data.frame of tagged variables.

Examples


if (require(outbreaks) && require(dplyr) && require(magrittr)) {

  ## create a tibble linelist
  x <- measles_hagelloch_1861 %>%
    tibble() %>%
    make_linelist(
      id = "case_ID",
      date_onset = "date_of_prodrome",
      age = "age",
      gender = "gender"
    )
  x

  ## get a data.frame of all tagged variables
  tags_df(x)
}
#> # A tibble: 188 × 4
#>       id date_onset gender   age
#>    <int> <date>     <fct>  <dbl>
#>  1     1 1861-11-21 f          7
#>  2     2 1861-11-23 f          6
#>  3     3 1861-11-28 f          4
#>  4     4 1861-11-27 m         13
#>  5     5 1861-11-22 f          8
#>  6     6 1861-11-26 m         12
#>  7     7 1861-11-24 m          6
#>  8     8 1861-11-21 m         10
#>  9     9 1861-11-26 m         13
#> 10    10 1861-11-21 f          7
#> # ℹ 178 more rows