EVOLUTION-MANAGER
Edit File: label_wrap.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 strings by wrapping across multiple lines</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_wrap {scales}"><tr><td>label_wrap {scales}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Label strings by wrapping across multiple lines</h2> <h3>Description</h3> <p>Uses <code><a href="../../base/html/strwrap.html">strwrap()</a></code> to split long labels across multiple lines. </p> <h3>Usage</h3> <pre> label_wrap(width) wrap_format(width) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>width</code></td> <td> <p>Number of characters per line.</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>wrap_format()</code> is retired; please use <code>label_format()</code> instead. </p> <h3>See Also</h3> <p>Other labels for discrete scales: <code><a href="label_parse.html">label_parse</a>()</code> </p> <h3>Examples</h3> <pre> x <- c( "this is a long label", "this is another long label", "this a label this is even longer" ) demo_discrete(x) demo_discrete(x, labels = label_wrap(10)) demo_discrete(x, labels = label_wrap(20)) </pre> <hr /><div style="text-align: center;">[Package <em>scales</em> version 1.1.1 <a href="00Index.html">Index</a>]</div> </body></html>