Learn R Programming

reportRmd (version 0.1.0)

set_var_labels: Set variable labels

Description

Set variable labels for a data frame using name-label pairs.

Usage

set_var_labels(data, ...)

Arguments

data

data frame containing variables to be labelled

...

Name-label pairs the name gives the name of the column in the output and the label is a character vector of length one.

Details

If no label is provided for a variable then the existing label will not be changed. To remove a label set the label to NA.

Examples

Run this code
# set labels using name-label pairs
# and return labelled data frame
ctDNA |> set_var_labels(
   ctdna_status="detectable ctDNA",
  cohort="A cohort label")

Run the code above in your browser using DataLab