R/run_example.R

Defines functions run_example

Documented in run_example

#' Run examples of use of 'shufflecards'
#'
#' @param example Name of the example, between : \code{"gapminder"}, \code{"bs-grid"}, \code{"grid-plot"}.
#'
#' @export
#'
#' @importFrom shiny runApp
#'
#' @examples
#' if (interactive()) {
#'
#' run_example("gapminder")
#'
#' }
run_example <- function(example = c("gapminder", "bs-grid", "grid-plot", "filter-sort")) {
  example <- match.arg(example)
  path <- file.path("examples", paste0(example, "-app"))
  runApp(
    appDir = system.file(path, package = "shufflecards", mustWork = TRUE),
    display.mode = "showcase"
  )
}
dreamRs/shufflecards documentation built on Dec. 4, 2019, 4:44 a.m.