lapplyDatasets | R Documentation |
Apply function for all generated datasets.
lapplyDatasets(datasets, FUN, ..., label, POST_FUN, datasetIndices = "all")
datasets |
Datasets list to be used to generate datasets. |
FUN |
the function to be applied to each generated dataset. The
function will be called like |
... |
optional arguments to |
label |
optional parameter, if present, each result is added an
attribute named label with the value of |
POST_FUN |
function to be applied to the result of |
datasetIndices |
optional vector of dataset indices to fit, useful to
try only a few datasets instead of all of them. Use |
list of results. The items in the resulting list will have two
additional attributes: datasetIndex
and proc.time
. If
FUN
failed for an item, then the item will be the error as
returned by try, i.e., it ill be of class try-error
.
Manuel Koller
oneWay <- generateAnovaDatasets(2, 1, 5, 4)
lapplyDatasets(oneWay, function(data) sum(data$y))
lapplyDatasets(oneWay, function(data) sum(data$y), POST_FUN = function(x) x^2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.