cache | R Documentation |
cache an R object
cache(name, expr, overwrite = FALSE, time = 3600, env = parent.frame())
name |
Name of the object |
expr |
Expression to evaluate |
overwrite |
If 'TRUE' saved over current objects |
time |
Either time (seconds) for how long to cache the object(s) or the time as a 'POSIXt' object |
env |
Environment to load object into if found |
Result of 'expr', or cached result
res <- .POSIXct(0) for (i in 1:6) { cache("foo", Sys.time(), time = 1) Sys.sleep(0.5) res[i] <- foo } res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.