Learn R Programming

units (version 1.0-0)

convert_to_base: Convert units to their base units

Description

Convert the units of a units object to their base units, as defined by the udunits database (SI units).

Usage

convert_to_base(x, simplify = TRUE, keep_fraction = TRUE)

Value

object of class units with units converted to base units.

Arguments

x

object of class units.

simplify

logical; if TRUE (default), the resulting units are simplified.

keep_fraction

logical; if TRUE (default), the result is kept as a fraction.

Examples

Run this code
x <- set_units(32, mJ/g)
convert_to_base(x)
convert_to_base(x, keep_fraction=FALSE)
convert_to_base(x, simplify=FALSE)
convert_to_base(x, simplify=FALSE, keep_fraction=FALSE)

Run the code above in your browser using DataLab