Wrapper for dplyr::bind_rows()
with additional checks
for duplicated statistics.
Arguments
- ...
(
dynamic-dots
)
ARDs to combine. Each argument can either be an ARD, or a list of ARDs. Columns are matched by name, and any missing columns will be filled withNA
.- .update
(
logical
)
logical indicating whether to update duplicate ARD statistics. Default isFALSE
. If a statistic type is repeated and.update=TRUE
, the more recently added statistics will be retained, and the others omitted.- .order
(
logical
)
logical indicating whether to order the rows of the stacked ARDs, allowing statistics that share common group and variable values to appear in consecutive rows. Default isFALSE
. Ordering will be based on the order of the group/variable values prior to stacking.
Examples
ard <- ard_categorical(ADSL, by = "ARM", variables = "AGEGR1")
bind_ard(ard, ard, .update = TRUE)
#> ℹ 27 duplicate observations removed.
#> {cards} data frame: 27 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 Xanomeli… AGEGR1 65-80 n n 55
#> 5 ARM Xanomeli… AGEGR1 65-80 N N 84
#> 6 ARM Xanomeli… AGEGR1 65-80 p % 0.655
#> 7 ARM Xanomeli… AGEGR1 65-80 n n 47
#> 8 ARM Xanomeli… AGEGR1 65-80 N N 84
#> 9 ARM Xanomeli… AGEGR1 65-80 p % 0.56
#> 10 ARM Placebo AGEGR1 <65 n n 14
#> ℹ 17 more rows
#> ℹ Use `print(n = ...)` to see more rows
#> ℹ 4 more variables: context, fmt_fn, warning, error