Description Usage Arguments Value Examples
Converts units; units can be arbitrarily complex as long as every dimension of each unit is present in unit.conversions
1 | convertUnits(old.units, new.units, attach.units = FALSE)
|
old.units |
character. The units to convert from. |
new.units |
character. The units to convert to. |
attach.units |
logical. Should units be attached to the conversion factor? |
a conversion factor that can be multiplied with data in the old.units to achieve data in the new.units
1 2 3 4 5 6 7 8 | loadflex:::convertUnits('mg/L', 'kg/m^3')
loadflex:::convertUnits('kg d^-1', 'kg/yr')
loadflex:::convertUnits('kg/yr', 'kg/d', attach.units = TRUE)
## Not run:
loadflex:::convertUnits('mg/L', 'm^3/d') # error: dimensions must match
loadflex:::convertUnits(unitbundle('ft^3 g L^-1 s^-1'), 'kg/d') # error: too complicated
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.