R/loadCaches.R

Defines functions loadCaches

Documented in loadCaches

#' Loads pre-made caches
#'
#' This function just takes a list of caches, and loads them. It's designed
#' for stuff you already cached previously, so it won't build any caches.
#'
#' @param cacheNames Vector of caches to load.
#' @param loadEnvir Environment into which to load each cache.
#' @param ... Additional parameters passed to simpleCache.
#' @export
#' @example
#' R/examples/example.R
loadCaches = function(cacheNames, loadEnvir=NULL, ...) {
  if (is.null(loadEnvir)) { loadEnvir = parent.frame(n=2) }
	for (i in 1:length(cacheNames)) {
		# By default, load these caches into the environment that
		# calls loadCaches (which is the grandparent, n=2, of the call to	
		# simpleCache.
		simpleCache(cacheNames[i], loadEnvir=loadEnvir, ...)
	}
}

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.