tests/testthat/_snaps/cohort.md

Basic form check

Code
  as.list(df_cohort)
Output
  $cohort
  [1] 2020-1 2020-2 2020-3 2020-4
  Levels: 2020-1 2020-2 2020-3 2020-4

  $`2020-01-01`
  [1] 100  NA  NA  NA

  $`2020-02-01`
  [1]  50 100  NA  NA

  $`2020-03-01`
  [1]  66.66667        NA 100.00000        NA

  $`2020-04-01`
  [1]  83.33333 100.00000 100.00000 100.00000

  $`2020-05-01`
  [1]  50  NA  NA 100

  $`2020-06-01`
  [1]  33.33333        NA  50.00000 100.00000

  $`2020-07-01`
  [1] 66.66667       NA       NA       NA

  $`2020-08-01`
  [1]  66.66667        NA        NA 100.00000

  $`2020-09-01`
  [1]  16.66667 100.00000        NA 100.00000

  $`2020-10-01`
  [1] 50 NA 50 NA

  $`2020-11-01`
  [1]  50  NA 100  NA

  $`2020-12-01`
  [1]  50 100  50  NA

  $`2021-01-01`
  [1]  50  NA 100 100
Code
  as.list(df_cohort2)
Output
  $cohort
  [1] All    2020-1 2020-2 2020-3 2020-4
  Levels: All 2020-1 2020-2 2020-3 2020-4

  $month_1
  [1] 100 100 100 100 100

  $month_2
  [1]  70  50 100 100 100

  $month_3
  [1]  70.00000  66.66667 100.00000  50.00000 100.00000

  $month_4
  [1]  80.00000  83.33333 100.00000  50.00000 100.00000

  $month_5
  [1]  60  50  NA 100 100

  $month_6
  [1]  40.00000  33.33333        NA  50.00000 100.00000

  $month_7
  [1]  60.00000  66.66667        NA 100.00000        NA

  $month_8
  [1] 40.00000 66.66667       NA       NA       NA

  $month_9
  [1] 10.00000 16.66667       NA       NA       NA

  $month_10
  [1] 30 50 NA NA NA

  $month_11
  [1] 30 50 NA NA NA

  $month_12
  [1] 30 50 NA NA NA

  $month_13
  [1] 30 50 NA NA NA

Test accuracy

Code
  as.list(df_cohort)
Output
  $cohort
  [1] 2020-1 2020-3
  Levels: 2020-1 2020-3

  $month_1
  [1] 100 100

  $month_2
  [1] 50 NA

  $month_3
  [1] 50 NA


vohai611/rcohort documentation built on April 13, 2022, 6:40 a.m.