EVOLUTION-MANAGER
Edit File: label_parse.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 with mathematical annotations</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_parse {scales}"><tr><td>label_parse {scales}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Label with mathematical annotations</h2> <h3>Description</h3> <p><code>label_parse()</code> produces expression from strings by parsing them; <code>label_math()</code> constructs expressions by replacing the pronoun <code>.x</code> with each string. </p> <h3>Usage</h3> <pre> label_parse() label_math(expr = 10^.x, format = force) parse_format() math_format(expr = 10^.x, format = force) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>expression to use</p> </td></tr> <tr valign="top"><td><code>format</code></td> <td> <p>another format function to apply prior to mathematical transformation - this makes it easier to use floating point numbers in mathematical expressions.</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>parse_format()</code> and <code>math_format()</code> was retired; please use <code>label_parse()</code> and <code>label_math()</code> instead. </p> <h3>See Also</h3> <p><a href="../../grDevices/html/plotmath.html">plotmath</a> for the details of mathematical formatting in R. </p> <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_ordinal.html">label_ordinal</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 discrete scales: <code><a href="label_wrap.html">label_wrap</a>()</code> </p> <h3>Examples</h3> <pre> # Use label_parse() with discrete scales greek <- c("alpha", "beta", "gamma") demo_discrete(greek) demo_discrete(greek, labels = label_parse()) # Use label_math() with continuous scales demo_continuous(c(1, 5)) demo_continuous(c(1, 5), labels = label_math(alpha[.x])) </pre> <hr /><div style="text-align: center;">[Package <em>scales</em> version 1.1.1 <a href="00Index.html">Index</a>]</div> </body></html>