txt_highlight | R Documentation |
Highlight words in a character vector. The words provided in terms
are
highlighted in the text by wrapping it around the following charater: |.
So 'I like milk and sugar in my coffee' would give 'I like |milk| and sugar in my coffee' if you
want to highlight the word milk
txt_highlight(x, terms)
x |
a character vector with text |
terms |
a vector of words to highlight which appear in |
A character vector with the same length of x
where the terms provided in terms
are put in between || to highlight them
x <- "I like milk and sugar in my coffee." txt_highlight(x, terms = "sugar") txt_highlight(x, terms = c("milk", "my"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.