install_symbolic_unit: Define new symbolic units

Description Usage Arguments Details See Also Examples

View source: R/user_conversion.R

Description

Adding a symbolic unit allows it to be used in as_units, make_units and set_units. No installation is performed if the unit is already known by udunits.

Usage

1
2
3

Arguments

name

a length 1 character vector that is the unit name or symbol.

warn

warns if the supplied unit symbol is already a valid unit symbol recognized by udunits.

dimensionless

logical; if TRUE, a new dimensionless unit is created, if FALSE a new base unit is created. Dimensionless units are convertible to other dimensionless units (such as rad), new base units are not convertible to other existing units.

Details

install_symbolic_unit installs a new dimensionless unit; these are directly compatible to any other dimensionless unit. To install a new unit that is a scaled or shifted version of an existing unit, use install_conversion_constant or install_conversion_offset directly.

See Also

install_conversion_constant, install_conversion_offset

Examples

1
2
install_symbolic_unit("person")
set_units(1, rad) + set_units(1, person) # that is how dimensionless units work!

r-quantities/units documentation built on March 31, 2020, 12:08 p.m.