This function ingests an ARD object of class card
and shuffles the information to prepare
for analysis. Helpful for streamlining across multiple ARDs.
Usage
shuffle_card(
x,
by = NULL,
trim = TRUE,
order_rows = TRUE,
fill_overall = "Overall {colname}",
fill_hierarchical_overall = "Any {colname}"
)
Arguments
- x
an ARD data frame of class 'card'
- by
Grouping variable(s) used in calculations. Defaults to
NULL
. If available (i.e. ifx
comes from a stacking function),attributes(x)$by
will be used instead ofby
.- trim
logical representing whether or not to trim away
fmt_fun
,error
, andwarning
columns- order_rows
logical representing whether or not to apply
cards::tidy_ard_row_order()
to sort the rows- fill_overall
scalar to fill missing grouping or variable levels. If a character is passed, then it is processed with
glue::glue()
where the colname element is available to inject into the string, e.g.Overall {colname}
may resolve to"Overall AGE"
for anAGE
column. Default isOverall {colname}
. IfNA
then no fill will occur.- fill_hierarchical_overall
scalar to fill variable levels for overall hierarchical calculations. If a character is passed, then it is processed with
glue::glue()
where the colname element is available to inject into the string, e.g.Any {colname}
may resolve to"Any AESOC"
for anAESOC
column. Default isAny {colname}
. IfNA
then no fill will occur.
Examples
if (FALSE) { # \dontrun{
cards::bind_ard(
cards::ard_categorical(cards::ADSL, by = "ARM", variables = "AGEGR1"),
cards::ard_categorical(cards::ADSL, variables = "ARM")
) |>
shuffle_card()
} # }