Learn R Programming

babelmixr2 (version 0.1.6)

simplifyUnit: Simplify units by removing repeated units from the numerator and denominator

Description

Simplify units by removing repeated units from the numerator and denominator

Usage

simplifyUnit(numerator = "", denominator = "")

Value

The units specified with units that are in both the numerator and denominator cancelled.

Arguments

numerator

The numerator of the units (or the whole unit specification)

denominator

The denominator of the units (or NULL if numerator is the whole unit specification)

Details

NA or "" for numerator and denominator are considered unitless.

See Also

Other Unit conversion: modelUnitConversion()

Examples

Run this code
simplifyUnit("kg", "kg/mL")
# units that don't match exactly are not cancelled
simplifyUnit("kg", "g/mL")

Run the code above in your browser using DataLab