R/setCacheRootPath.R

Defines functions setCacheRootPath

Documented in setCacheRootPath

#' Set Cache Root Path
#'
#' @param path the cache root directory (DEFAULT: a temporary directory, 
#'   but this can be change to a more permanent location) 
#' 
#' @examples 
#' setCacheRootPath()
#' \dontrun{
#' setCacheRootPath("~/.simpleRCache")
#' }
#' 
#' @export
setCacheRootPath <- function(path=tempdir()) {
  if(!file.exists(path)) {
    dir.create(path)
  }

  options("simpleRCacheRoot" = path)
}

Try the simpleRCache package in your browser

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

simpleRCache documentation built on July 16, 2021, 1:07 a.m.