cli_vec | R Documentation |
Add custom cli style to a vector
cli_vec(x, style = list())
x |
Vector that will be collapsed by cli. |
style |
Style to apply to the vector. It is used as a theme on
a |
You can use this function to change the default parameters of collapsing the vector into a string, see an example below.
The style is added as an attribute, so operations that remove attributes will remove the style as well.
v <- cli_vec( c("foo", "bar", "foobar"), style = list("vec-sep" = " & ", "vec-last" = " & ") ) cli_text("My list: {v}.")
#> My list: foo & bar & foobar.
x <- cli_vec(names(mtcars), list("vec-trunc" = 3)) cli_text("Column names: {x}.")
#> Column names: mpg, cyl, disp, …, gear, and carb.
cli_format()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.