R/lockCache.R

Defines functions lockCache

Documented in lockCache

#' Lock a cache; whenever the function tries to evaluate rather than read from
#' the cache, it will fail with an error. Useful, if you want to ensure
#' reproduction of former execution
#' @param f The function to lock the cache from
#' @export
lockCache <- function(f) {
  if (!isCacheLocked(f))
    file.create(paste0(getCacheDir(f), '/locked'))
  invisible(NULL)
}
fnbn/cachifyR documentation built on May 5, 2019, 6:58 p.m.