View source: R/set_column_units.R
set_column_units | R Documentation |
Add label attribute using 'dplyr' syntax using the [Hmisc::unit()]
set_column_units(x, ...)
x |
The data frame that we want to define units on |
... |
Variable names with their intended unit, e.g. 'hp = "Hp"'. |
The original data.frame
Other Hmisc helpers:
set_column_labels()
library(magrittr)
data(mtcars)
mtcars_with_units <- mtcars %>%
set_column_units(wt = "1000 lbs")
Hmisc::units(mtcars_with_units$wt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.