Skip to contents

Opens only the example you ask for, like shiny::runExample(), and copies or writes no files. Use run = FALSE to read the app's code or pass its directory to shiny::runApp(). The single-file scenarios can be copied into a project with Shiny, bslib and mascot installed (long-task also needs promises and later). Copy the whole folder for the studio, golem and rhino-shaped examples; golem also needs the golem package. "theme" is a page of the studio's app: run = FALSE returns the studio's app.R, and run = TRUE opens the app on that page, as mascot_studio() with view = "theme" does.

Usage

mascot_example(name, ..., run = TRUE)

Arguments

name

A required non-empty string from mascot_examples()'s name column. NULL is not accepted.

...

Must be empty. Forces the arguments after it to be named.

run

A logical flag, defaulting to TRUE, to launch the app in an interactive R session. FALSE returns its app.R path without launching it. NULL is not accepted.

Value

With run = FALSE, an absolute path to the existing app.R file. With run = TRUE, the value returned by shiny::runApp() after the app stops.

See also

Examples

basename(mascot_example("form-check", run = FALSE))
#> [1] "app.R"
if (FALSE) { # interactive()
mascot_example("studio")
}