Open kyle-messier opened 1 year ago
As briefly discussed in #44 , the inclusion of SI units into field/variable names needs to be considered in relation to other discussion points including:
units
package, which leverages udunit2 and is usually used with sf
, is a good tool to keep units with the covariate valueslibrary(units)
#> udunits database from /Users/songi2/Library/R/arm64/4.3/library/units/share/udunits/udunits2.xml
# length
(distance_km = set_units(15, "km"))
#> 15 [km]
(distance_mi = set_units(distance_km, "mi"))
#> 9.320568 [mi]
# complex units
(thermal_kj = set_units(1e4, "kJ*km^-2"))
#> 10000 [kJ/km^2]
(thermal_calories = set_units(thermal_kj, "kcal*mi^-2"))
#> 6186.08 [kcal/mi^2]
# basically dimensionless; but we can keep this unit with values
(moisture_kgkg = set_units(0.25, "kg*kg^-1"))
#> 0.25 [kg/kg]
is.numeric(moisture_kgkg)
#> [1] TRUE
Created on 2023-09-19 with reprex v2.0.2
related to "reasonable mean" - the value should be within the expected for the SI unit. Could also have a field/variable name that specifies the SI units