Get unit id, shortname, symbol or name of a value in accordance with StoX convention.
value to read unit from
the property of the unit that is to be returned (e.g. 'symbol' or 'name')
formatted as StoxUnits
the unit of value. <NA> if unit is not set
dt <- data.table::data.table(weight=c(1000,1200))
dt$weight <- setUnit(dt$weight, "mass-g")
print(getUnit(dt$weight, "name"))
#> [1] "gram"