cache | R Documentation |
If the file exists, the expression is not evaluated – the cached result is returned. If the file path does not exist, the expression is evaluated and stored as a parquet file at the location specified by the path. To trigger a re-run, delete the file.
cache(expr, path)
expr |
An R expression that returns a |
path |
A file path (where to save/load the object) |
tmp <- tempfile()
cache(Ex1.1(N=10), tmp) # saves to cache (slow)
cache(Ex1.1(N=10), tmp) # loads from cache (fast)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.