[Experimental]
Print method for objects of class 'card'.

# S3 method for class 'card'
print(
  x,
  width = NULL,
  ...,
  n = NULL,
  max_extra_cols = NULL,
  max_footer_lines = NULL
)

# S3 method for class 'card'
ctl_new_pillar(controller, x, width, ..., title = NULL)

# S3 method for class 'card'
tbl_format_setup(x, width = NULL, ...)

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

Arguments

x

(data.frame)
object of class 'card'

width

(integer)
width of the printed output

...

(dynamic-dots)
passed to the underlying pillar/tibble methods

n

(integer)
number of rows to print

(integer)
passed to tibble::print.tbl(); control the number of columns and footer lines listed in the footer

controller, title

arguments passed by the pillar print machinery; not called directly

Value

an ARD data frame of class 'card' (invisibly)

Details

ARD tibbles print like a typical tibble (via the pillar package) with a few ARD-specific adaptations:

  • the header reads An ARD data frame instead of A tibble

  • list-columns whose elements are scalars print the value of the element, falling back to the standard tibble summary (e.g. <chr [2]>, <fn>) for non-scalar elements

  • when the tibble is too wide for the console, all-NULL error and warning columns are suppressed first, then (after the usual column shrinking) the fmt_fun, stat_label, stat_fmt, and context columns are dropped in that order before falling back to the standard tibble behaviour. Suppressed columns are reported in the footer.

Examples

ard_tabulate(ADSL, variables = AGEGR1) |>
  print()
#> # An ARD data frame: 9 × 9
#>   variable variable_level context  stat_name stat_label    stat fmt_fun
#>   <chr>    <list>         <chr>    <chr>     <chr>       <list> <list> 
#> 1 AGEGR1   65-80          tabulate n         n          144     0      
#> 2 AGEGR1   65-80          tabulate N         N          254     0      
#> 3 AGEGR1   65-80          tabulate p         %            0.567 <fn>   
#> 4 AGEGR1   <65            tabulate n         n           33     0      
#> 5 AGEGR1   <65            tabulate N         N          254     0      
#> 6 AGEGR1   <65            tabulate p         %            0.130 <fn>   
#> 7 AGEGR1   >80            tabulate n         n           77     0      
#> 8 AGEGR1   >80            tabulate N         N          254     0      
#> 9 AGEGR1   >80            tabulate p         %            0.303 <fn>   
#> # ℹ 2 more variables: warning <list>, error <list>