convertUnits {omnibus} | R Documentation |
Convert length or areal units
Description
This function converts length and area values from one unit to another (e.g., meters to miles, or square yards to acres). Alternatively, it provides the conversion factor for changing one unit to another.
Usage
convertUnits(from = NULL, to = NULL, x = NULL)
Arguments
from , to |
Character: Names of the units to convert from/to. Partial matching is used, and case is ignored. Valid values are listed below. The
|
x |
Numeric or |
See Also
expandUnits
, conversionFactors
Examples
# conversion
convertUnits(from = 'm', to = 'km', 250)
convertUnits(from = 'm', to = 'mi', 250)
convertUnits(from = 'm2', to = 'km2', 250)
# conversion factors
convertUnits(from = 'm', to = 'km')
convertUnits(from = 'm')
convertUnits(to = 'm')