R/example.R

Defines functions ipsum_examples

Documented in ipsum_examples

#' Get a shinipsum example
#'
#' @param which The example to run. If empty, all the available examples are listed.
#'
#' @return A path to the example.
#' @export
#'
#' @examples
#' ipsum_examples()

ipsum_examples <- function(which = NULL){
  if (is.null(which)){
    list.files(
      system.file("examples", package = "shinipsum")
    )
  } else {
    normalizePath(
      file.path(
        system.file("examples", which, package = "shinipsum")
      )
    )
  }
}

Try the shinipsum package in your browser

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

shinipsum documentation built on May 29, 2024, 2:30 a.m.