Skip to contents

[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)
}
#> Warning: `select_tags()` was deprecated in linelist 1.0.0.
#>  This function is deprecated: use the two step `tags_df()` and
#>   `dplyr::select()` process instead
#>     gender age
#> 1        f   7
#> 2        f   6
#> 3        f   4
#> 4        m  13
#> 5        f   8
#> 6        m  12
#> 7        m   6
#> 8        m  10
#> 9        m  13
#> 10       f   7
#> 11       f  11
#> 12       f   7
#> 13       m  13
#> 14       f  13
#> 15       m   8
#> 16       f  15
#> 17       f  10
#> 18       f   2
#> 19       m  11
#> 20       m  10
#> 21       f  13
#> 22       f  10
#> 23       f   7
#> 24       m   4
#> 25       f  12
#> 26       m   7
#> 27       m   5
#> 28       f  10
#> 29       m  13
#> 30       f  11
#> 31       f   9
#> 32       m   7
#> 33       f   7
#> 34       m  11
#> 35       f  13
#> 36       m  11
#> 37       m  13
#> 38    <NA>  12
#> 39       m  10
#> 40       m  13
#> 41       m  12
#> 42       f   4
#> 43       m   2
#> 44       m  10
#> 45       m   7
#> 46       m  13
#> 47       f  11
#> 48       f   3
#> 49       m  10
#> 50       f   6
#> 51       m   4
#> 52       m  13
#> 53       m   6
#> 54       m   4
#> 55       f  11
#> 56       m   8
#> 57       m   3
#> 58       m   9
#> 59       f  10
#> 60       m   2
#> 61       f   5
#> 62       m  14
#> 63       m  12
#> 64       m   7
#> 65       m   2
#> 66       f   5
#> 67       f  11
#> 68       f   2
#> 69       m   1
#> 70       m  13
#> 71       f  10
#> 72       f  10
#> 73       f  11
#> 74       f  10
#> 75       m  13
#> 76       m   2
#> 77       f   8
#> 78       f  11
#> 79       f   5
#> 80       m  12
#> 81       m  12
#> 82       m   8
#> 83       f  10
#> 84       m   6
#> 85       f   5
#> 86       f   3
#> 87       f  12
#> 88       f  10
#> 89       f   3
#> 90       m  11
#> 91       f   4
#> 92       f   2
#> 93       m   8
#> 94       f   4
#> 95       m   1
#> 96       m   2
#> 97       m  10
#> 98       m   3
#> 99       m   5
#> 100      m  12
#> 101      f   7
#> 102      m  12
#> 103   <NA>  12
#> 104      m   5
#> 105      m   3
#> 106      m   4
#> 107      f  12
#> 108      m   6
#> 109      f   6
#> 110      m   3
#> 111      m  12
#> 112      m  10
#> 113      f   0
#> 114   <NA>  13
#> 115      f  11
#> 116      m   8
#> 117      m  14
#> 118      f   2
#> 119      f   0
#> 120      m   1
#> 121      m  10
#> 122      f   1
#> 123      f   1
#> 124      m   3
#> 125      f   2
#> 126   <NA>   5
#> 127      m   1
#> 128      m   5
#> 129      f   4
#> 130      f  12
#> 131      m   1
#> 132      m  11
#> 133      f   2
#> 134      m  13
#> 135      m   2
#> 136      f  13
#> 137      f  10
#> 138   <NA>  11
#> 139   <NA>  13
#> 140   <NA>   2
#> 141      f   4
#> 142      m   5
#> 143      f  11
#> 144      m   2
#> 145      f   8
#> 146      f   4
#> 147      f   0
#> 148      f  13
#> 149      m   4
#> 150      m   0
#> 151      f   2
#> 152      f   4
#> 153      f  10
#> 154      f   6
#> 155      m  13
#> 156      m   8
#> 157      f   4
#> 158      f   3
#> 159      f   2
#> 160      f   0
#> 161      f   6
#> 162      f   6
#> 163      f   1
#> 164      m   3
#> 165      m   2
#> 166      m   1
#> 167      m   0
#> 168      m   1
#> 169      m   4
#> 170      m  10
#> 171      m   0
#> 172      f   3
#> 173      m   6
#> 174      f   3
#> 175      m   2
#> 176   <NA>   0
#> 177      f   8
#> 178      m   4
#> 179      f   1
#> 180      m  10
#> 181      f  10
#> 182      m  13
#> 183      m   4
#> 184   <NA>  13
#> 185      m   3
#> 186   <NA>   6
#> 187      m   0
#> 188   <NA>   1