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")))]
}
databio/simpleCache documentation built on April 24, 2021, 12:30 a.m.