extract_labels {reportRmd}R 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
ctDNA <- ctDNA |> set_var_labels(
   ctdna_status="detectable ctDNA",
  cohort="A cohort label")
# Extract labels
extract_labels(ctDNA)

[Package reportRmd version 0.1.0 Index]