lapplyDatasets {robustlmm} | R Documentation |
Lapply for generated datasets
Description
Apply function for all generated datasets.
Usage
lapplyDatasets(datasets, FUN, ..., label, POST_FUN, datasetIndices = "all")
Arguments
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 |
Value
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
.
Author(s)
Manuel Koller
Examples
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)