Skip to contents

This function prints linelist objects.

Usage

# S3 method for class 'linelist'
print(x, ...)

Arguments

x

a linelist object

...

further arguments to be passed to 'print'

Value

Invisibly returns the object.

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"
  )

  ## print object - using only the first few entries
  head(x)

  # version with a tibble
  if (require(tibble) && require(magrittr)) {
    measles_hagelloch_1861 %>%
      tibble() %>%
      make_linelist(
        id = "case_ID",
        date_onset = "date_of_prodrome",
        age = "age",
        gender = "gender"
      )
  }
}
#> Loading required package: tibble
#> 
#> // linelist object
#> # A tibble: 188 × 12
#>    case_ID infector date_of_prodrome date_of_rash date_of_death   age gender
#>      <int>    <int> <date>           <date>       <date>        <dbl> <fct> 
#>  1       1       45 1861-11-21       1861-11-25   NA                7 f     
#>  2       2       45 1861-11-23       1861-11-27   NA                6 f     
#>  3       3      172 1861-11-28       1861-12-02   NA                4 f     
#>  4       4      180 1861-11-27       1861-11-28   NA               13 m     
#>  5       5       45 1861-11-22       1861-11-27   NA                8 f     
#>  6       6      180 1861-11-26       1861-11-29   NA               12 m     
#>  7       7       42 1861-11-24       1861-11-28   NA                6 m     
#>  8       8       45 1861-11-21       1861-11-26   NA               10 m     
#>  9       9      182 1861-11-26       1861-11-30   NA               13 m     
#> 10      10       45 1861-11-21       1861-11-25   NA                7 f     
#> # ℹ 178 more rows
#> # ℹ 5 more variables: family_ID <int>, class <fct>, complications <fct>,
#> #   x_loc <dbl>, y_loc <dbl>
#> 
#> // tags: id:case_ID, date_onset:date_of_prodrome, gender:gender, age:age