Learn R Programming

easyr (version 0.3-1)

save.cache: Save Cache Saves the arguments to a cache file, using the cache.num last checked with cache.ok.

Description

Save Cache

Saves the arguments to a cache file, using the cache.num last checked with cache.ok.

Usage

save.cache(...)

Arguments

...

Objects to save.

Examples

Run this code
# NOT RUN {
# check the first cache to see if it exists and dependent files haven't changed.
# if this check is TRUE, code in brackets will get skipped and the cache will be loaded instead.
# set do.load = FALSE if you have multiple files that build a cache, 
#    to prevent multiple cache loads.
# output will be printed to the console to tell you if the cache was loaded or re-built.
if( ! cache.ok(1) ){

  # do stuff
  
  # if this is the final file for this cache, end with save.cache to save passed objects as a cache.
  save.cache(iris)
}

# delete the cache folder to close out the example.
system( "rm -r cache" )

# }

Run the code above in your browser using DataLab