EVOLUTION-MANAGER
Edit File: label_number_si.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 numbers with SI prefixes (2k, 1M, 5T 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_number_si {scales}"><tr><td>label_number_si {scales}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Label numbers with SI prefixes (2k, 1M, 5T etc)</h2> <h3>Description</h3> <p><code>number_si()</code> automatically scales and labels with the best SI prefix, "K" for values <i>≥</i> 10e3, "M" for <i>≥</i> 10e6, "B" for <i>≥</i> 10e9, and "T" for <i>≥</i> 10e12. </p> <h3>Usage</h3> <pre> label_number_si(accuracy = 1, unit = NULL, sep = NULL, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <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>unit</code></td> <td> <p>Optional units specifier.</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>Separator between number and SI unit. Defaults to <code>" "</code> if <code>units</code> is supplied, and <code>""</code> if not.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Other arguments passed on to <code><a href="../../base/html/format.html">base::format()</a></code>.</p> </td></tr> </table> <h3>Value</h3> <p>All <code>label_()</code> functions return a "labelling" function, i.e. a function that takes a vector <code>x</code> and returns a character vector of <code>length(x)</code> giving a label for each input value. </p> <p>Labelling functions are designed to be used with the <code>labels</code> argument of ggplot2 scales. The examples demonstrate their use with x scales, but they work similarly for all scales, including those that generate legends rather than axes. </p> <h3>See Also</h3> <p>Other labels for continuous scales: <code><a href="label_bytes.html">label_bytes</a>()</code>, <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_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_bytes.html">label_bytes</a>()</code>, <code><a href="label_scientific.html">label_scientific</a>()</code> </p> <h3>Examples</h3> <pre> demo_continuous(c(1, 1e9), label = label_number_si()) demo_continuous(c(1, 5000), label = label_number_si(unit = "g")) demo_continuous(c(1, 1000), label = label_number_si(unit = "m")) demo_log10(c(1, 1e9), breaks = log_breaks(10), labels = label_number_si()) </pre> <hr /><div style="text-align: center;">[Package <em>scales</em> version 1.1.1 <a href="00Index.html">Index</a>]</div> </body></html>