EVOLUTION-MANAGER
Edit File: label_bytes.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: Label bytes (1 kb, 2 MB, etc)</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 label_bytes {scales}"><tr><td>label_bytes {scales}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Label bytes (1 kb, 2 MB, etc)</h2> <h3>Description</h3> <p>Scale bytes into human friendly units. Can use either SI units (e.g. kB = 1000 bytes) or binary units (e.g. kiB = 1024 bytes). See <a href="http://en.wikipedia.org/wiki/Units_of_information">Units of Information</a> on Wikipedia for more details. </p> <h3>Usage</h3> <pre> label_bytes(units = "auto_si", accuracy = 1, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>units</code></td> <td> <p>Unit to use. Should either one of: </p> <ul> <li><p> "kB", "MB", "GB", "TB", "PB", "EB", "ZB", and "YB" for SI units (base 1000). </p> </li> <li><p> "kiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", and "YiB" for binary units (base 1024). </p> </li> <li> <p><code>auto_si</code> or <code>auto_binary</code> to automatically pick the most approrpiate unit for each value. </p> </li></ul> </td></tr> <tr valign="top"><td><code>accuracy</code></td> <td> <p>A number to round to. Use (e.g.) <code>0.01</code> to show 2 decimal places of precision. If <code>NULL</code>, the default, uses a heuristic that should ensure breaks have the minimum number of digits needed to show the difference between adjacent values. </p> <p>Applied to rescaled data.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Other arguments passed on to <code><a href="number.html">number()</a></code></p> </td></tr> </table> <h3>Value</h3> <p>A labeller function that takes a numeric vector of breaks and returns a character vector of labels. </p> <h3>See Also</h3> <p>Other labels for continuous scales: <code><a href="label_dollar.html">label_dollar</a>()</code>, <code><a href="label_number_auto.html">label_number_auto</a>()</code>, <code><a href="label_number_si.html">label_number_si</a>()</code>, <code><a href="label_ordinal.html">label_ordinal</a>()</code>, <code><a href="label_parse.html">label_parse</a>()</code>, <code><a href="label_percent.html">label_percent</a>()</code>, <code><a href="label_pvalue.html">label_pvalue</a>()</code>, <code><a href="label_scientific.html">label_scientific</a>()</code> </p> <p>Other labels for log scales: <code><a href="label_number_si.html">label_number_si</a>()</code>, <code><a href="label_scientific.html">label_scientific</a>()</code> </p> <h3>Examples</h3> <pre> demo_continuous(c(1, 1e6)) demo_continuous(c(1, 1e6), label = label_bytes()) # Force all to use same units demo_continuous(c(1, 1e6), label = label_bytes("kB")) # Auto units are particularly nice on log scales demo_log10(c(1, 1e6)) demo_log10(c(1, 1e7), label = label_bytes()) # You can also use binary units where a megabyte is defined as # (1024) ^ 2 bytes rather than (1000) ^ 2. You'll need to override # the default breaks to make this more informative. demo_continuous(c(1, 1024^2), label = label_bytes("auto_binary")) demo_continuous(c(1, 1024^2), breaks = breaks_width(250 * 1024), label = label_bytes("auto_binary") ) </pre> <hr /><div style="text-align: center;">[Package <em>scales</em> version 1.1.1 <a href="00Index.html">Index</a>]</div> </body></html>