EVOLUTION-MANAGER
Edit File: plot.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: create axis label with appropriate labels</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 plot.units {units}"><tr><td>plot.units {units}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>create axis label with appropriate labels</h2> <h3>Description</h3> <p>create axis label with appropriate labels </p> <p>plot unit objects </p> <h3>Usage</h3> <pre> make_unit_label(lab, u, sep = units_options("sep"), group = units_options("group"), parse = units_options("parse")) ## S3 method for class 'units' plot(x, y, xlab = NULL, ylab = NULL, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>lab</code></td> <td> <p>length one character; name of the variable to plot</p> </td></tr> <tr valign="top"><td><code>u</code></td> <td> <p>vector of class <code>units</code></p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>length two character vector, defaulting to <code>c("~","~")</code>, with the white space between unit name and unit symbols, and between subsequent symbols.</p> </td></tr> <tr valign="top"><td><code>group</code></td> <td> <p>length two character vector with grouping symbols, e.g. <code>c("(",")")</code> for parenthesis, or <code>c("","")</code> for no group symbols</p> </td></tr> <tr valign="top"><td><code>parse</code></td> <td> <p>logical; indicates whether a parseable expression should be returned (typically needed for super scripts), or a simple character string without special formatting.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>object of class units, to plot along the x axis, or, if y is missing, along the y axis</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>object to plot along the y axis, or missing</p> </td></tr> <tr valign="top"><td><code>xlab</code></td> <td> <p>character; x axis label</p> </td></tr> <tr valign="top"><td><code>ylab</code></td> <td> <p>character; y axis label</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>other parameters, passed on to <a href="../../graphics/html/plot.default.html">plot.default</a></p> </td></tr> </table> <h3>Details</h3> <p><a href="units_options.html">units_options</a> can be used to set and change the defaults for <code>sep</code>, <code>group</code> and <code>doParse</code>. </p> <h3>Examples</h3> <pre> oldpar = par(mar = par("mar") + c(0, .3, 0, 0)) displacement = mtcars$disp * ud_units[["in"]]^3 # an example that would break if parse were (default) TRUE, since 'in' is a reserved word: units_options(parse=FALSE) make_unit_label("displacement", displacement) units_options(parse=TRUE) units(displacement) = with(ud_units, cm^3) weight = mtcars$wt * 1000 * with(ud_units, lb) units(weight) = with(ud_units, kg) plot(weight, displacement) units_options(group = c("(", ")") ) # parenthesis instead of square brackets plot(weight, displacement) units_options(sep = c("~~~", "~"), group = c("", "")) # no brackets; extra space plot(weight, displacement) units_options(sep = c("~", "~~"), group = c("[", "]")) gallon = as_units("gallon") consumption = mtcars$mpg * with(ud_units, mi/gallon) units(consumption) = with(ud_units, km/l) plot(displacement, consumption) # division in consumption units_options(negative_power = TRUE) # division becomes ^-1 plot(displacement, consumption) plot(1/displacement, 1/consumption) par(oldpar) </pre> <hr /><div style="text-align: center;">[Package <em>units</em> version 0.6-7 <a href="00Index.html">Index</a>]</div> </body></html>