%as% is a binary operator on strings with units in them
grapes-as-grapes.RdThe function calls the units utility and converts the string on the
left into the unit on the right, e.g.: "cm" %as% "inches", both
units can contain numbers. Any input that is accepted by the units
utility is acceptable, as long as it makes sense with the command
line arguments: units --strict --compact -1 "$originalUnit" "$targetUnit"
Arguments
- txtUnit
a string with numeric values, including units, e.g. "3 cm", can be a character vector
- target
string, target unit, e.g. "m", must be scalar