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
TRUE if the value
has unit, FALSE if not.
dt <- data.table::data.table(weight=c(1000,1200))
dt$weight <- setUnit(dt$weight, "mass-g")
print(hasUnit(dt$weight))
#> [1] TRUE
print(hasUnit(1))
#> [1] FALSE