R/data-utils.R
extract_units.Rd
Extracts units set as dataframe column attributes
extract_units(df)
the data frame from set_units()
set_units()
a named list of column / unit pairs.
iris = iris %>% set_units(-Species, units="mm") iris %>% extract_units() #> Sepal.Length Sepal.Width Petal.Length Petal.Width #> "mm" "mm" "mm" "mm" #> attr(,"na.action") #> Species #> 5 #> attr(,"class") #> [1] "omit"