Skip to content

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.

Usage

random_phrases_add(language = "en", praise = NULL, encouragement = NULL)

Arguments

language

The language of the phrases to be added.

praise, encouragement

A vector of praising or encouraging phrases, including final punctuation.

Value

Returns the previous custom phrases invisibly when called in the global setup chunk or interactively. Otherwise, it returns a shiny pre- rendered chunk.

Usage in learnr tutorials

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:

Alternatively, you can call random_phrases_add() in a separate, standard R chunk (with echo = FALSE):

Examples

random_phrases_add("demo", praise = "Great!", encouragement = "Try again.")
random_praise(language = "demo")
#> [1] "Great!"
random_encouragement(language = "demo")
#> [1] "Try again."