Learn R Programming

cards (version 0.6.1)

unlist_ard_columns: Unlist ARD Columns

Description

Unlist ARD Columns

Usage

unlist_ard_columns(
  x,
  columns = c(where(is.list), -any_of(c("warning", "error", "fmt_fun"))),
  fill = NA,
  fct_as_chr = TRUE
)

Value

a data frame

Arguments

x

(data.frame)
an ARD data frame of class 'card' or any data frame

columns

(tidy-select)
columns to unlist. Default is c(where(is.list), -any_of(c("warning", "error", "fmt_fun"))).

fill

(scalar)
scalar to fill NULL values with before unlisting (if they are present). Default is NA.

fct_as_chr

(scalar logical)
When TRUE, factor elements will be converted to character before unlisting. When the column being unlisted contains mixed types of classes, the factor elements are often converted to the underlying integer value instead of retaining the label. Default is TRUE.

Examples

Run this code
ADSL |>
  ard_categorical(by = ARM, variables = AGEGR1) |>
  apply_fmt_fun() |>
  unlist_ard_columns()

ADSL |>
  ard_continuous(by = ARM, variables = AGE) |>
  apply_fmt_fun() |>
  unlist_ard_columns()

Run the code above in your browser using DataLab