loading...

These functions are convenient in the framework of a course whose learnrs and Shiny applications may be updated during the course. The update() function checks if an update is available (respecting the version of R), and the run() (for learnrs), or runApp() (for Shiny applications) manage to run the item in a friendly way.

run(
  tutorial,
  package,
  github_repos = NULL,
  ...,
  update = ask,
  ask = interactive(),
  upgrade = "never"
)

run_app(
  app,
  package,
  github_repos = NULL,
  ...,
  update = ask,
  ask = interactive(),
  upgrade = "never",
  in.job = TRUE,
  max.wait = 60
)

update_pkg(package, github_repos, upgrade = "never")

Arguments

tutorial

The name of the tutorial to use. If not provided, a list of available tutorials is displayed.

package

The package from where to run the tutorial.

github_repos

The GitHub repository where the package is developed (for updates), use NULL to prevent any updates.

...

Further arguments passed to run_tutorial() (for learnrs), or to runApp() (for Shiny applications).

update

Do we check for an updated version first, and if it is found, update the package automatically?

ask

In case tutorial or app is not provided, do we ask to select in a list?

upgrade

When a new version of the main package is found, do we also upgrade dependencies ? By default, never, but use "ask" to ask user.

app

The name of the Shiny application to run. If not provided, a list of available apps is displayed.

in.job

Should the application be run in a Job in RStudio (TRUE by default)?

max.wait

How many seconds do we wait for the Shiny app to start (60 sec by default)?

Value

The result returned by run_tutorial() for run(), or by runApp() for run_app(). The update() function return TRUE or FALSE, depending if the package is updated or not.

See also

run_tutorial(), runApp()

Examples

if (FALSE) {
#' # To start from a list of available tutorials:
run(package = "my_package")
run("my_tutorial", package = "my_package")
run_app(package = "mypackage")
run_app("my_shiny_app", package = "mypackage")
}