R/runExample.R

Defines functions runExample

Documented in runExample

#' Run a colourpicker example
#'
#' Launch a \code{colourpicker} example Shiny app that shows how to use the
#' \code{colourInput} control. \cr
#' The example is also
#' \href{https://daattali.com/shiny/colourInput/}{available online}.
#' @examples
#' ## Only run this example in interactive R sessions
#' if (interactive()) {
#'   runExample()
#' }
#' @export
runExample <- function() {
  appDir <- system.file("examples", "colourInput", package = "colourpicker")
  if (appDir == "") {
    stop("Could not find example directory. Try re-installing `colourpicker`.",
         call. = FALSE)
  }

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

Try the colourpicker package in your browser

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

colourpicker documentation built on Aug. 21, 2023, 9:11 a.m.