select_tags: Extract tagged variables of a linelist object

View source: R/select_tags.R

select_tagsR Documentation

Extract tagged variables of a linelist object

Description

[Deprecated] This function was equivalent to running successively tags_df() and dplyr::select() on a linelist object. To encourage users to understand what is going on and in order to follow the software engineering good practice of providing just one way to do a given task, this function is now deprecated.

Usage

select_tags(x, ...)

Arguments

x

a linelist object

...

the tagged variables to select, using dplyr::select() compatible terminology; see tags_names() for default values

Value

A data.frame of tagged variables.

See Also

  • tags() for existing tags in a linelist

  • tags_df() to get a data.frame of all tags

Examples

if (require(outbreaks)) {

  ## dataset we'll create a linelist from
  measles_hagelloch_1861

  ## create linelist
  x <- make_linelist(measles_hagelloch_1861,
    id = "case_ID",
    date_onset = "date_of_prodrome",
    age = "age",
    gender = "gender"
  )
  head(x)

  ## check tagged variables
  tags(x)

  # DEPRECATED!
  select_tags(x, "gender", "age")

  # Instead, use:
  library(dplyr)
  x %>%
    tags_df() %>%
    select(gender, age)
}


epiverse-trace/linelist documentation built on April 26, 2024, 5:35 a.m.