| cache {Biobase} | R Documentation |
Cache the evaluation of an expression in the file system.
cache(name, expr)
name |
A character of length 1. |
expr |
An expression. |
This function can be useful during the development of computationally
intensive workflows, for example in vignettes or scripts.
The function uses a cache file in the current working directory whose
name is obtained by paste("tmp-", name, ".RData", sep="").
When cache is called and the cache file exists, it is loaded and
the object whose name is given by name is returned. expr
is not evaluted.
When cache is called and the cache file does not exist,
expr is evaluted, and its value is saved into the file under
the name given by name and returned.
To delete all cache files, command like rm tmp-* should do.
The (cached) value of expr.
Wolfgang Huber, huber@ebi.ac.uk
myComplicatedObject <- cache("myComplicatedObject", { runif(10) })