R/listCaches.R

Defines functions listCaches

Documented in listCaches

#' Show available caches.
#'
#' Lists any cache files in the cache directory.
#'
#' @param cacheSubDir Optional parameter to specify a subdirectory of the cache folder.
#' @return \code{character} vector in which each element is the path to a file that 
#'         represents an available cache (within \code{getOption("RCACHE.DIR")})
#' @export
#' @example
#' R/examples/example.R
listCaches = function(cacheSubDir="") {
	cacheDirFiles = list.files(paste0(getCacheDir(), cacheSubDir))
	cacheDirFiles[which(sapply(cacheDirFiles, function(f) endsWith(f, ".RData")))]
}

Try the simpleCache package in your browser

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

simpleCache documentation built on April 17, 2021, 9:08 a.m.