EVOLUTION-MANAGER
Edit File: label_ordinal.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 ordinal numbers (1st, 2nd, 3rd, 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_ordinal {scales}"><tr><td>label_ordinal {scales}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Label ordinal numbers (1st, 2nd, 3rd, etc)</h2> <h3>Description</h3> <p>Round values to integers and then display as ordinal values (e.g. 1st, 2nd, 3rd). Built-in rules are provided for English, French, and Spanish. </p> <h3>Usage</h3> <pre> label_ordinal( prefix = "", suffix = "", big.mark = " ", rules = ordinal_english(), ... ) ordinal_english() ordinal_french(gender = c("masculin", "feminin"), plural = FALSE) ordinal_spanish() ordinal_format( prefix = "", suffix = "", big.mark = " ", rules = ordinal_english(), ... ) ordinal( x, prefix = "", suffix = "", big.mark = " ", rules = ordinal_english(), ... ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>prefix, suffix</code></td> <td> <p>Symbols to display before and after value.</p> </td></tr> <tr valign="top"><td><code>big.mark</code></td> <td> <p>Character used between every 3 digits to separate thousands.</p> </td></tr> <tr valign="top"><td><code>rules</code></td> <td> <p>Named list of regular expressions, matched in order. Name gives suffix, and value specifies which numbers to match.</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> <tr valign="top"><td><code>gender</code></td> <td> <p>Masculin or feminin gender for French ordinal.</p> </td></tr> <tr valign="top"><td><code>plural</code></td> <td> <p>Plural or singular for French ordinal.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>A numeric vector to format.</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>Old interface</h3> <p><code>ordinal()</code> and <code>format_ordinal()</code> are retired; please use <code>label_ordinal()</code> instead. </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_number_si.html">label_number_si</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> <h3>Examples</h3> <pre> demo_continuous(c(1, 5)) demo_continuous(c(1, 5), labels = label_ordinal()) demo_continuous(c(1, 5), labels = label_ordinal(rules = ordinal_french())) # The rules are just a set of regular expressions that are applied in turn ordinal_french() ordinal_english() # Note that ordinal rounds values, so you may need to adjust the breaks too demo_continuous(c(1, 10)) demo_continuous(c(1, 10), labels = label_ordinal()) demo_continuous(c(1, 10), labels = label_ordinal(), breaks = breaks_width(2) ) </pre> <hr /><div style="text-align: center;">[Package <em>scales</em> version 1.1.1 <a href="00Index.html">Index</a>]</div> </body></html>