Learn R Programming

cards (version 0.9.0)

print.card: Print

Description

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

Usage

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

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

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

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

Value

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

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

max_extra_cols, max_footer_lines

(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

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

Run this code
ard_tabulate(ADSL, variables = AGEGR1) |>
  print()

Run the code above in your browser using DataLab