Learn R Programming

cards (version 0.3.0)

bind_ard: Bind ARDs

Description

Wrapper for dplyr::bind_rows() with additional checks for duplicated statistics.

Usage

bind_ard(
  ...,
  .distinct = TRUE,
  .update = FALSE,
  .order = FALSE,
  .quiet = FALSE
)

Value

an ARD data frame of class 'card'

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 with NA.

.distinct

(logical)
logical indicating whether to remove non-distinct values from the ARD. Duplicates are checked across grouping variables, primary variables, context (if present), the statistic name and the statistic value. Default is FALSE. If a statistic name and value is repeated and .distinct=TRUE, the more recently added statistics will be retained, and the other(s) omitted.

.update

(logical)
logical indicating whether to update ARD and remove duplicated named statistics. Duplicates are checked across grouping variables, primary variables, and the statistic name. Default is FALSE. If a statistic name is repeated and .update=TRUE, the more recently added statistics will be retained, and the other(s) 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 is FALSE. Ordering will be based on the order of the group/variable values prior to stacking.

.quiet

(logical)
logical indicating whether to suppress any messaging. Default is FALSE

Examples

Run this code
ard <- ard_categorical(ADSL, by = "ARM", variables = "AGEGR1")

bind_ard(ard, ard, .update = TRUE)

Run the code above in your browser using DataLab