EVOLUTION-MANAGER
Edit File: glue_col.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: Construct strings with color</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 glue_col {glue}"><tr><td>glue_col {glue}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Construct strings with color</h2> <h3>Description</h3> <p>The <a href="../../crayon/html/crayon.html">crayon</a> package defines a number of functions used to color terminal output. <code>glue_col()</code> and <code>glue_data_col()</code> functions provide additional syntax to make using these functions in glue strings easier. </p> <p>Using the following syntax will apply the function <code>crayon::blue()</code> to the text 'foo bar'.</p> <pre>{blue foo bar} </pre> <p>If you want an expression to be evaluated, simply place that in a normal brace expression (these can be nested).</p> <pre>{blue 1 + 1 = {1 + 1}} </pre> <h3>Usage</h3> <pre> glue_col(..., .envir = parent.frame(), .na = "NA") glue_data_col(.x, ..., .envir = parent.frame(), .na = "NA") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>[<code>expressions</code>]<br /> Unnamed arguments are taken to be expressions string(s) to format. Multiple inputs are concatenated together before formatting. Named arguments are taken to be temporary variables available for substitution.</p> </td></tr> <tr valign="top"><td><code>.envir</code></td> <td> <p>[<code>environment</code>: <code>parent.frame()</code>]<br /> Environment to evaluate each expression in. Expressions are evaluated from left to right. If <code>.x</code> is an environment, the expressions are evaluated in that environment and <code>.envir</code> is ignored. If <code>NULL</code> is passed it is equivalent to <code><a href="../../base/html/environment.html">emptyenv()</a></code>.</p> </td></tr> <tr valign="top"><td><code>.na</code></td> <td> <p>[<code>character(1)</code>: ‘NA’]<br /> Value to replace NA values with. If <code>NULL</code> missing values are propagated, that is an <code>NA</code> result will cause <code>NA</code> output. Otherwise the value is replaced by the value of <code>.na</code>.</p> </td></tr> <tr valign="top"><td><code>.x</code></td> <td> <p>[<code>listish</code>]<br /> An environment, list or data frame used to lookup values.</p> </td></tr> </table> <h3>Examples</h3> <pre> if (require(crayon)) { glue_col("{blue foo bar}") glue_col("{blue 1 + 1 = {1 + 1}}") white_on_grey <- bgBlack $ white glue_col("{white_on_grey Roses are {red {colors()[[552]]}} Violets are {blue {colors()[[26]]}} `glue_col()` can show {red c}{yellow o}{green l}{cyan o}{blue r}{magenta s} and {bold bold} and {underline underline} too! }") } </pre> <hr /><div style="text-align: center;">[Package <em>glue</em> version 1.4.2 <a href="00Index.html">Index</a>]</div> </body></html>