Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

install_conversion_constant

Install a conversion constant or offset between user-defined units.


Description

Tells the units package how to convert between units that have a linear relationship, i.e. can be related on the form y = α x (constant) or y = α + x (offset).

Usage

install_conversion_constant(from, to, const)

install_conversion_offset(from, to, const)

Arguments

from

String for the symbol of the unit being converted from.

to

String for the symbol of the unit being converted to. One of from and to must be an existing unit name.

const

The constant α in the conversion.

Details

This function handles the very common case where units are related through a linear function, that is, you can convert from one to the other as y = α x. Using this function, you specify that you can go from values of type from to values of type to by multiplying by a constant, or adding a constant.


units

Measurement Units for R Vectors

v0.7-1
GPL-2
Authors
Edzer Pebesma [aut, cre] (<https://orcid.org/0000-0001-8049-7069>), Thomas Mailund [aut], Tomasz Kalinowski [aut], James Hiebert [ctb], Iñaki Ucar [aut] (<https://orcid.org/0000-0001-6403-5550>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.