Skip to content
Snippets Groups Projects
Select Git revision
  • fc2994cf04c4de13308322480bc994212f67e889
  • master default protected
  • feature/quantileforecast
  • develop
  • add_kseq
5 results

cache_save.R

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    cache_save.R 536 B
    #' Saves the object as an .RDS file with the filename
    #'
    #' See the examples for \code{\link{cache_name}()}.
    #'
    #' @title Save a cache file (name generated with \code{code_name()}
    #' @param object The object to cache (i.e. the value of the evaluating function).
    #' @param filename The cache file name (i.e. use the one generated by cache_name, see examples).
    #' @return NULL
    #'
    #' @export
    cache_save <- function(object, filename){
        dir.create(dirname(filename), showWarnings=FALSE, recursive=TRUE)
        saveRDS(object, filename)
    }