EVOLUTION-MANAGER
Edit File: cli_vec.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: Add custom cli style to a vector</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 cli_vec {cli}"><tr><td>cli_vec {cli}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Add custom cli style to a vector</h2> <h3>Description</h3> <p>Add custom cli style to a vector </p> <h3>Usage</h3> <pre> cli_vec(x, style = list()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>Vector that will be collapsed by cli.</p> </td></tr> <tr valign="top"><td><code>style</code></td> <td> <p>Style to apply to the vector. It is used as a theme on a <code>span</code> element that is created for the vector. You can set <code>vec-sep</code> and <code>vec-last</code> to modify the separator and the last separator.</p> </td></tr> </table> <h3>Details</h3> <p>You can use this function to change the default parameters of collapsing the vector into a string, see an example below. </p> <p>The style is added as an attribute, so operations that remove attributes will remove the style as well. </p> <h4>Custom collapsing separator</h4> <div class="sourceCode r"><pre>v <- cli_vec( c("foo", "bar", "foobar"), style = list("vec-sep" = " & ", "vec-last" = " & ") ) cli_text("My list: {v}.") </pre></div> <div class="asciicast" style="color: #172431;font-family: 'Fira Code',Monaco,Consolas,Menlo,'Bitstream Vera Sans Mono','Powerline Symbols',monospace;line-height: 1.300000"><pre> #> My list: foo & bar & foobar. </pre></div> <h4>Custom truncation</h4> <div class="sourceCode r"><pre>x <- cli_vec(names(mtcars), list("vec-trunc" = 3)) cli_text("Column names: {x}.") </pre></div> <div class="asciicast" style="color: #172431;font-family: 'Fira Code',Monaco,Consolas,Menlo,'Bitstream Vera Sans Mono','Powerline Symbols',monospace;line-height: 1.300000"><pre> #> Column names: mpg, cyl, disp, …, gear, and carb. </pre></div> <h3>See Also</h3> <p><code><a href="cli_format.html">cli_format()</a></code> </p> <hr /><div style="text-align: center;">[Package <em>cli</em> version 3.4.1 <a href="00Index.html">Index</a>]</div> </body></html>