extract_labels: Extract variable labels from labelled data frame

View source: R/lblCode.R

extract_labelsR Documentation

Extract variable labels from labelled data frame

Description

Extract variable labels from data and return a data frame with labels

Usage

extract_labels(data, sep = "_")

Arguments

data

the data frame to extract labels from

sep

character used to separate multiple labels, defaults to "_"

Details

All variable names will be returned, even those with no labels. If the label attribute has length greater than one the values will be concatenated and returned as a single string separated by sep

Examples

# Set a few variable labels for ctDNA
data("ctDNA")
ctDNA <- ctDNA |> set_var_labels(
   ctdna_status="detectable ctDNA",
  cohort="A cohort label")
# Extract labels
extract_labels(ctDNA)

reportRmd documentation built on April 4, 2025, 2:03 a.m.