Learn R Programming

cards (version 0.7.0)

.derive_overall_labels: Derive overall labels

Description

Transform the "..cards_overall.." and "..hierarchical_overall.." labels into "Overall <variable_name>" and "Any <variable_name>" respectively. Also it ensures the labels are unique (in case they already exist) with make.unique() which appends a sequence number.

Usage

.derive_overall_labels(x, cur_col = dplyr::cur_column())

Value

a character vector

Arguments

x

(character) content of target (current) column

cur_col

(character) name of current column

Examples

Run this code
data <- dplyr::tibble(
  ARM = c("..cards_overall..", "Overall ARM", NA, "BB", NA),
  TRTA = c(NA, NA, "..hierarchical_overall..", "C", "C")
)

data |>
  dplyr::mutate(
    dplyr::across(
      ARM:TRTA,
      cards:::.derive_overall_labels
    )
  )

Run the code above in your browser using DataLab