Stack multiple ARD calls sharing common input data
and by
variables.
Optionally incorporate additional information on represented variables (i.e.
big N's, missingness, attributes) and/or tidy for use in displays with
shuffle_ard()
.
Usage
ard_stack(
data,
by = NULL,
...,
.overall = FALSE,
.missing = FALSE,
.attributes = FALSE,
.shuffle = FALSE
)
Arguments
- data
(
data.frame
)
a data frame- by
(
tidy-select
)
columns to tabulate by in the series of ARD function calls- ...
(
dynamic-dots
)
Series of ARD function calls to be run and stacked- .overall
(
logical
)
logical indicating whether overall statistics should be calculated (i.e. re-run allard_*()
calls withby=NULL
). Default isFALSE
.- .missing
(
logical
)
logical indicating whether to include the results ofard_missing()
for all variables represented in the ARD. Default isFALSE
.- .attributes
(
logical
)
logical indicating whether to include the results ofard_attributes()
for all variables represented in the ARD. Default isFALSE
.- .shuffle
(
logical
)
logical indicating whether to performshuffle_ard()
on the final result. Default isFALSE
.
Examples
ard_stack(
data = ADSL,
by = "ARM",
ard_categorical(variables = "AGEGR1"),
ard_continuous(variables = "AGE")
)
#> {cards} data frame: 54 x 11
#> group1 group1_level variable variable_level stat_name stat_label stat
#> 1 ARM Placebo AGEGR1 65-80 n n 42
#> 2 ARM Placebo AGEGR1 65-80 N N 86
#> 3 ARM Placebo AGEGR1 65-80 p % 0.488
#> 4 ARM Placebo AGEGR1 <65 n n 14
#> 5 ARM Placebo AGEGR1 <65 N N 86
#> 6 ARM Placebo AGEGR1 <65 p % 0.163
#> 7 ARM Placebo AGEGR1 >80 n n 30
#> 8 ARM Placebo AGEGR1 >80 N N 86
#> 9 ARM Placebo AGEGR1 >80 p % 0.349
#> 10 ARM Xanomeli… AGEGR1 65-80 n n 55
#> ℹ 44 more rows
#> ℹ Use `print(n = ...)` to see more rows
#> ℹ 4 more variables: context, fmt_fn, warning, error
ard_stack(
data = ADSL,
by = "ARM",
ard_categorical(variables = "AGEGR1"),
ard_continuous(variables = "AGE"),
.shuffle = TRUE
)
#> # A tibble: 54 × 6
#> ARM variable label context stat_name stat
#> <chr> <fct> <chr> <chr> <chr> <dbl>
#> 1 Placebo AGEGR1 65-80 categorical n 42
#> 2 Placebo AGEGR1 65-80 categorical N 86
#> 3 Placebo AGEGR1 65-80 categorical p 0.488
#> 4 Placebo AGEGR1 <65 categorical n 14
#> 5 Placebo AGEGR1 <65 categorical N 86
#> 6 Placebo AGEGR1 <65 categorical p 0.163
#> 7 Placebo AGEGR1 >80 categorical n 30
#> 8 Placebo AGEGR1 >80 categorical N 86
#> 9 Placebo AGEGR1 >80 categorical p 0.349
#> 10 Xanomeline High Dose AGEGR1 65-80 categorical n 55
#> # ℹ 44 more rows