run_tutorial: Run a tutorial

View source: R/run.R

run_tutorialR Documentation

Run a tutorial


Run a tutorial provided by an installed R package.


  name = NULL,
  package = NULL,
  shiny_args = NULL,
  clean = FALSE,
  as_rstudio_job = NULL



Tutorial name (subdirectory within tutorials/ directory of installed package). Alternatively, if package is not provided, name may be a path to a local tutorial R Markdown file or a local directory containing a learnr tutorial. If package is provided, name must be the tutorial name.


Name of package. If name is a path to the local directory containing a learnr tutorial, then package should not be provided.


Unused. Included for future expansion and to ensure named arguments are used.


Additional arguments to forward to shiny::runApp.


When TRUE, the shiny prerendered HTML files are removed and the tutorial is re-rendered prior to starting the tutorial.


Runs the tutorial in the background as an RStudio job. This is the default behavior when run_tutorial() detects that RStudio is available and can run jobs. Set to FALSE to disable and to run the tutorial in the current R session.

When running as an RStudio job, run_tutorial() sets or overrides the launch.browser option for shiny_args. You can instead use the shiny.launch.browser global option in your current R session to set the default behavior when the tutorial is run. See the shiny options documentation for more information.


Starts a Shiny server running the learnr tutorial.

See Also

safe and available_tutorials


# display all "learnr" tutorials

# run basic example within learnr
## Not run: 
run_tutorial("hello", "learnr")

## End(Not run)

learnr documentation built on Sept. 28, 2023, 9:06 a.m.