R/readData_example.R

Defines functions readData_example

Documented in readData_example

# Copyright 2017-2018 John Gagnon
# This program is distributed under the terms of the GNU General Public License

#' Get path to readData example
#'
#' readData comes bundled with a example files in its `inst/applications/www`
#' directory. This function makes them easy to access.
#'
#' @param path Name of file. If `NULL`, the example files will be listed.
#' @return Located example excel file in package
#' @examples
#' readData_example(path = "iris.xlsx")
#' @export
readData_example <- function(path = NULL) {
  if (is.null(path)) {
    dir(system.file("application/www", package = "plotGrouper"))
  } else {
    system.file("application/www",
                path,
                package = "plotGrouper",
                mustWork = TRUE)
  }
}

Try the plotGrouper package in your browser

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

plotGrouper documentation built on Nov. 8, 2020, 5:25 p.m.