lapply
, these functions apply a given function to each data
component in
the input multiData
structure, and optionally simplify the result to an array if possible.mtd.apply(
# What to do
multiData, FUN, ..., # Pre-existing results and update options
mdaExistingResults = NULL, mdaUpdateIndex = NULL,
mdaCopyNonData = FALSE,
# Output formatting options
mdaSimplify = FALSE,
returnList = FALSE,
# Internal behaviour options
mdaVerbose = 0, mdaIndent = 0)
mtd.applyToSubset(
# What to do
multiData, FUN, ...,
# Which rows and cols to keep
mdaRowIndex = NULL, mdaColIndex = NULL,
# Pre-existing results and update options
mdaExistingResults = NULL, mdaUpdateIndex = NULL,
mdaCopyNonData = FALSE,
# Output formatting options
mdaSimplify = FALSE,
returnList = FALSE,
# Internal behaviour options
mdaVerbose = 0, mdaIndent = 0)
FUN
.multiData
. Each element must be
a logical or numeric vector that specifies rows in each data
component
to select before applying the function.data
component
to select before applying the function.multiData
have changed and recalculating the unchanged ones is computationally
expensive. If not given, all calculations will be performed. IfmultiData
the calculation should
actually be carried out. This argument has an effect only if mdaExistingResults
is non-NULL. If the
length of mdaExistingResults
(call the lengmultiData
be copied into the output?
Note that the copying is incompatible with simplification; enabling both will trigger an error.mdaSimplify
is TRUE
, this argument is
ignored.data
component in the
input multiData structure. Other components are simply copied.data
component. In a "strict" multiData structure, the
data
components are required to each be a matrix or a data frame and have the same number of
columns. In a "loose" multiData structure, the data
components can be anything (but for most
purposes should be of comparable type and content).mtd.apply
works on any "loose" multiData structure; mtd.applyToSubset
assumes (and checks
for) a "strict" multiData structure.
multiData
to create a multiData structure;
mtd.applyToSubset
for applying a function to a subset of a multiData structure;
mtd.mapply
for vectorizing over several arguments.