tests/testthat/_snaps/abnormal_by_baseline.md

s_count_abnormal_by_baseline works with healthy input and default arguments

Code
  res
Output
  $fraction
  $fraction$not_abnormal
    num denom 
      1     3 
  attr(,"label")
  [1] "Not low"

  $fraction$abnormal
    num denom 
      0     1 
  attr(,"label")
  [1] "Low"

  $fraction$total
    num denom 
      1     4 
  attr(,"label")
  [1] "Total"
Code
  res
Output
  $fraction
  $fraction$not_abnormal
    num denom 
      1     3 
  attr(,"label")
  [1] "Not high"

  $fraction$abnormal
    num denom 
      1     1 
  attr(,"label")
  [1] "High"

  $fraction$total
    num denom 
      2     4 
  attr(,"label")
  [1] "Total"

s_count_abnormal_by_baseline also works with tibble and custom arguments

Code
  res
Output
  $fraction
  $fraction$not_abnormal
    num denom 
      2     5 
  attr(,"label")
  [1] "Not low"

  $fraction$abnormal
    num denom 
      0     1 
  attr(,"label")
  [1] "Low"

  $fraction$total
    num denom 
      2     6 
  attr(,"label")
  [1] "Total"
Code
  res
Output
  $fraction
  $fraction$not_abnormal
    num denom 
      1     5 
  attr(,"label")
  [1] "Not high"

  $fraction$abnormal
    num denom 
      0     1 
  attr(,"label")
  [1] "High"

  $fraction$total
    num denom 
      1     6 
  attr(,"label")
  [1] "Total"

count_abnormal_by_baseline throws warning with character var

Code
  res
Output
  $fraction
  $fraction$not_abnormal
    num denom 
      2     4 
  attr(,"label")
  [1] "Not low"

  $fraction$abnormal
    num denom 
      0     1 
  attr(,"label")
  [1] "Low"

  $fraction$total
    num denom 
      2     5 
  attr(,"label")
  [1] "Total"

count_abnormal_by_baseline works with default arguments

Code
  res
Output
                 all obs  
  ————————————————————————
  Low                     
    Not low    1/3 (33.3%)
    Low            0/1    
    Total       1/4 (25%) 
  High                    
    Not high    1/2 (50%) 
    High        1/2 (50%) 
    Total       2/4 (50%)

count_abnormal_by_baseline works with custom arguments

Code
  res
Output
               all obs
  ————————————————————
  Low                 
    Not low     1 / 3 
    Low         0 / 1 
    Total       1 / 4 
  High                
    Not high    1 / 2 
    High        1 / 2 
    Total       2 / 4


Try the tern package in your browser

Any scripts or data that you put into this service are public.

tern documentation built on Sept. 24, 2024, 9:06 a.m.