File: runExample.R

package info (click to toggle)
r-cran-colourpicker 1.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,744 kB
  • sloc: javascript: 1,490; makefile: 13; sh: 3
file content (21 lines) | stat: -rw-r--r-- 668 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#' 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")
}