Run a tutorial which is contained within an R package.
run_tutorial(name = NULL, package = NULL, shiny_args = NULL)Tutorial name (subdirectory within tutorials/
directory of installed package).
Name of package
Additional arguments to forward to
shiny::runApp.
Note that when running a tutorial Rmd file with run_tutorial
the tutorial Rmd should have already been rendered as part of the
development of the package (i.e. the corresponding tutorial .html file for
the .Rmd file must exist).
# display all "learnr" tutorials
available_tutorials("learnr")
#> Available tutorials:
#> * learnr
#> - ex-data-basics : "Data basics"
#> - ex-data-filter : "Filter observations"
#> - ex-data-mutate : "Create new variables"
#> - ex-data-summarise : "Summarise Tables"
#> - ex-setup-r : "Set Up"
#> - hello : "Hello, Tutorial!"
#> - quiz_question : "Tutorial Quiz Questions in `learnr`"
#> - slidy : "Slidly demo"
# run basic example within learnr
if (FALSE) run_tutorial("hello", "learnr")