set_column_labels: Add [Hmisc::label()] to multiple columns

View source: R/set_column_labels.R

set_column_labelsR Documentation

Add [Hmisc::label()] to multiple columns

Description

Add label attribute using 'dplyr' syntax using the [Hmisc::label()]

Usage

set_column_labels(x, ...)

Arguments

x

The data frame that we want to label

...

Variable names with their intended label, e.g. 'mpg = "Miles per gallon"'.

Value

The original data.frame

See Also

Other Hmisc helpers: set_column_units()

Examples

library(magrittr)
data(mtcars)
mtcars_with_labels <- mtcars %>%
  set_column_labels(mpg = "Gas",
                    cyl = "Cylinders",
                    hp = "Strength")
Hmisc::label(mtcars_with_labels$mpg)

Gmisc documentation built on Aug. 26, 2023, 1:07 a.m.