View source: R/functional-by-sim.R
by_sim()
is similar to apply()
in that it applies a
function .f
to the margins of an array. by_sim()
is
specialised to apply the function on each simulation of a
sims_array
. It can be also be applied to a list of
simulations, in which case .f
may depend on several
parameters.
1 2 3 4 5 6 7 8 9 10 11 | by_sim(.x, .f, ..., .context = list(), .bindings = NULL)
## S3 method for class 'list'
by_sim(.x, .f, ..., .context = list(), .bindings = NULL)
## S3 method for class 'sims'
by_sim(.x, .f, ..., .context = list(), .bindings = NULL)
## S3 method for class 'sims_array'
by_sim(.x, .f, ..., .context = list(), .sims = list(),
.bindings = NULL)
|
.x |
A list of simulations arrays, or a simulations array. |
.f |
A function or an expression to be applied to each simulation. |
... |
Further arguments passed on to |
.context |
A list or a data frame that contains additional
variables used in |
.bindings |
A named vector linking the arguments of |
.sims |
A list of simulations arrays containing additional
parameters on which |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.