EVOLUTION-MANAGER
Edit File: install_conversion_constant.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Install a conversion constant or offset between user-defined...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for install_conversion_constant {units}"><tr><td>install_conversion_constant {units}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Install a conversion constant or offset between user-defined units.</h2> <h3>Description</h3> <p>Tells the <code>units</code> package how to convert between units that have a linear relationship, i.e. can be related on the form <i>y = α x</i> (constant) or <i>y = α + x</i> (offset). </p> <h3>Usage</h3> <pre> install_conversion_constant(from, to, const) install_conversion_offset(from, to, const) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>from</code></td> <td> <p>String for the symbol of the unit being converted from.</p> </td></tr> <tr valign="top"><td><code>to</code></td> <td> <p>String for the symbol of the unit being converted to. One of <code>from</code> and <code>to</code> must be an existing unit name.</p> </td></tr> <tr valign="top"><td><code>const</code></td> <td> <p>The constant <i>α</i> in the conversion.</p> </td></tr> </table> <h3>Details</h3> <p>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 <i>y = α x</i>. Using this function, you specify that you can go from values of type <code>from</code> to values of type <code>to</code> by multiplying by a constant, or adding a constant. </p> <h3>See Also</h3> <p><code><a href="install_symbolic_unit.html">install_symbolic_unit</a></code>, <code><a href="install_symbolic_unit.html">remove_symbolic_unit</a></code> </p> <h3>Examples</h3> <pre> # one orange is worth two apples install_symbolic_unit("orange") install_conversion_constant("orange", "apple", 2) # apple = 2 * orange apples <- 2 * as_units("apple") oranges <- 1 * as_units("orange") apples + oranges oranges + apples install_conversion_offset("meter", "newmeter", 1) m = set_units(1:3, meter) n = set_units(1:3, newmeter) m + n n + m </pre> <hr /><div style="text-align: center;">[Package <em>units</em> version 0.6-7 <a href="00Index.html">Index</a>]</div> </body></html>