Description Usage Arguments Examples
Similar to 'do.call', 'do.call.stash' constructs and executes a function call. Additionally, 'do.call.stash' stores the result indexed by the function body, its arguments, and its dependencies.
1 2 | ## S3 method for class 'call.stash'
do(fun, argslist)
|
fun |
Function to apply. Unlike 'do.call', strings naming the function are not supported |
argslist |
List of arguments to 'fun', in order. |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
heavy_function <- function(x) {
Sys.sleep(3)
mean(x)
}
result <- NULL
system.time({result <- do.call.stash(heavy_function, list(c(1:20)))})
result
system.time({result <- do.call.stash(heavy_function, list(c(1:20)))})
result
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.