Skip to contents

Extracts units set as dataframe column attributes

Usage

extract_units(df)

Arguments

df

the data frame from set_units()

Value

a named list of column / unit pairs.

Examples

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"