set_column_labels {Gmisc} | R 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)
[Package Gmisc version 3.0.3 Index]