unit_conv {apsimx}R Documentation

performs common unit conversions

Description

This function is slowly getting better. Adding more unit conversions as I need them.

Usage

unit_conv(x, from, to, ...)

Arguments

x

input variable

from

original units

to

target units

...

additional arguments passed to specific conversions

Details

Function which performs common unit conversions

At the moment possible conversions are:

This is for metric and Imperial conversions Source: https://www.extension.iastate.edu/agdm/wholefarm/html/c6-80.html

Value

value of the input variable with new units

Examples


grain.yield.gm2 <- 600
grain.yield.kgha <- unit_conv(grain.yield.gm2, from = "g/m2", to = "kg/ha")
grain.yield.kgha
## Converting coordinates
require(sp)
unit_conv("42d 0' 0\" N", from = "degrees", to = "decimal")
unit_conv(42, from = "decimal", to = "degrees") ## EW by default
unit_conv(42, from = "decimal", to = "degrees", NS = TRUE)



[Package apsimx version 2.6.2 Index]