flair | R Documentation |
Adds decorative formatting to parts of a string or source code.
flair(x, pattern, before = NULL, after = NULL, ...) flair_rx(x, pattern, before = NULL, after = NULL, ...) ## S3 method for class 'decorated' flair_rx(x, pattern, before = NULL, after = NULL, ...) ## Default S3 method: flair_rx(x, pattern, before = NULL, after = NULL, ...) flair_quick(x, pattern, before = NULL, after = NULL, ...) flair_all(x, ...) ## Default S3 method: flair_all(x, ...) ## S3 method for class 'decorated' flair_all(x, ...) flair_args(x, ...) flair_funs(x, ...) flair_input_vals(x, ...)
x |
A string or |
pattern |
A pattern to match. By default, this is a fixed pattern;
use |
before |
String giving specific html tags to insert before matched text. |
after |
String giving specific html tags to insert after matched text. |
... |
Formatting style options, passed to |
If input is a string object, flair
returns a formatted string.
If input is a decorated
object, flair
returns a
decorated
object with the source elements formatted.
Currently, flair
is only built for html formatting.
A string with formatting wrappers.
code_string <- "foo <- mean(1:10, na.rm = TRUE)" code_string %>% flair("foo") code_string %>% flair_args() code_string %>% flair_funs(color = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.