unlist_ard_columns {cards}R Documentation

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
)

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.

Value

a data frame

Examples

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()

[Package cards version 0.6.1 Index]