R/runExample.R

Defines functions runExample

Documented in runExample

#' Run ggExtra example
#'
#' Launch a Shiny app that shows a demo of what can be done with
#' \code{ggExtra::ggMarginal}.
#'
#' This example is also
#' \href{https://daattali.com/shiny/ggExtra-ggMarginal-demo/}{available online}.
#'
#' @examples
#' ## Only run this example in interactive R sessions
#' if (interactive()) {
#'   runExample()
#' }
#' @export
runExample <- function() {
  appDir <- system.file("examples", "ggMarginal", package = "ggExtra")
  if (appDir == "") {
    stop("Could not find example directory. Try re-installing `ggExtra`.",
      call. = FALSE
    )
  }

  shiny::runApp(appDir, display.mode = "normal")
}
daattali/ggExtra documentation built on Aug. 20, 2023, 3:30 a.m.