EVOLUTION-MANAGER
Edit File: units.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: Set measurement units on a numeric vector</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 units {units}"><tr><td>units {units}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Set measurement units on a numeric vector</h2> <h3>Description</h3> <p>Set measurement units on a numeric vector </p> <p>Convert units </p> <p>retrieve measurement units from <code>units</code> object </p> <h3>Usage</h3> <pre> ## S3 replacement method for class 'numeric' units(x) <- value ## S3 replacement method for class 'units' units(x) <- value ## S3 replacement method for class 'logical' units(x) <- value ## S3 method for class 'units' units(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>numeric vector, or object of class <code>units</code></p> </td></tr> <tr valign="top"><td><code>value</code></td> <td> <p>object of class <code>units</code> or <code>symbolic_units</code>, or in the case of <code>set_units</code> expression with symbols that can be resolved in <a href="ud_units.html">ud_units</a> (see examples).</p> </td></tr> </table> <h3>Details</h3> <p>if <code>value</code> is of class <code>units</code> and has a value unequal to 1, this value is ignored unless <code>units_options("simplifiy")</code> is <code>TRUE</code>. If <code>simplify</code> is <code>TRUE</code>, <code>x</code> is multiplied by this value. </p> <h3>Value</h3> <p>object of class <code>units</code> </p> <p>the units method retrieves the units attribute, which is of class <code>symbolic_units</code> </p> <h3>Examples</h3> <pre> x = 1:3 class(x) units(x) <- as_units("m/s") class(x) y = 2:5 a <- set_units(1:3, m/s) units(a) <- with(ud_units, km/h) a # convert to a mixed_units object: units(a) = c("m/s", "km/h", "km/h") a </pre> <hr /><div style="text-align: center;">[Package <em>units</em> version 0.6-7 <a href="00Index.html">Index</a>]</div> </body></html>