random_phrases_add | R Documentation |
Augment the random phrases available in random_praise()
and
random_encouragement()
with phrases of your own. Note that these phrases
are added to the existing phrases, rather than overwriting them.
random_phrases_add(language = "en", praise = NULL, encouragement = NULL)
language |
The language of the phrases to be added. |
praise, encouragement |
A vector of praising or encouraging phrases, including final punctuation. |
Returns the previous custom phrases invisibly when called in the global setup chunk or interactively. Otherwise, it returns a shiny pre- rendered chunk.
To add random phrases in a learnr tutorial, you can either include one or
more calls to random_phrases_add()
in your global setup chunk:
```{r setup, include = FALSE}`r ''` library(learnr) random_phrases_add( language = "en", praise = "Great work!", encouragement = "I believe in you." ) ```
Alternatively, you can call random_phrases_add()
in a separate, standard
R chunk (with echo = FALSE
):
```{r setup-phrases, echo = FALSE}`r ''` random_phrases_add( language = "en", praise = c("Great work!", "You're awesome!"), encouragement = c("I believe in you.", "Yes we can!") ) ```
random_phrases_add("demo", praise = "Great!", encouragement = "Try again.")
random_praise(language = "demo")
random_encouragement(language = "demo")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.