R/runExample.R

Defines functions runSignupExample runPortalExample runPricingExample

Documented in runPortalExample runPricingExample runSignupExample

#' Run examples of using shinyservicebot in a Shiny app
#'
#' @examples
#' if (interactive()) {
#'   runPricingExample()
#' }
#' @export
runPricingExample <- function() {
  appDir <- system.file("example/shinypricingexample", package = "shinyservicebot")
  if (appDir == "") {
    stop("Could not find example directory. Try re-installing `shinyservicebot`.", call. = FALSE)
  }

  shiny::runApp(appDir, display.mode = "normal")
}

#' Run examples of using shinyservicebot in a Shiny app
#'
#' @examples
#' if (interactive()) {
#'   runPortalExample()
#' }
#' @export
runPortalExample <- function() {
  appDir <- system.file("example/shinyportalexample", package = "shinyservicebot")
  if (appDir == "") {
    stop("Could not find example directory. Try re-installing `shinyservicebot`.", call. = FALSE)
  }

  shiny::runApp(appDir, display.mode = "normal")
}

#' Run examples of using shinyservicebot in a Shiny app
#'
#' @examples
#' if (interactive()) {
#'   runSignupExample()
#' }
#' @export
runSignupExample <- function() {
  appDir <- system.file("example/shinysignupexample", package = "shinyservicebot")
  if (appDir == "") {
    stop("Could not find example directory. Try re-installing `shinyservicebot`.", call. = FALSE)
  }

  shiny::runApp(appDir, display.mode = "normal")
}

Try the shinyservicebot package in your browser

Any scripts or data that you put into this service are public.

shinyservicebot documentation built on July 1, 2020, 9:37 p.m.