mtd.mapply | R Documentation |
Inspired by mapply
, this function applies a given function to each data
component in
the input multiData arguments, and optionally simplify the result to an array if possible.
mtd.mapply(
# What to do
FUN, ..., MoreArgs = NULL,
# How to interpret the input
mdma.argIsMultiData = NULL,
# Copy previously known results?
mdmaExistingResults = NULL, mdmaUpdateIndex = NULL,
# How to format output
mdmaSimplify = FALSE,
returnList = FALSE,
# Options controlling internal behaviour
mdma.doCollectGarbage = FALSE,
mdmaVerbose = 0, mdmaIndent = 0)
FUN |
Function to be applied. |
... |
Arguments to be vectorized over. These can be multiData structures or simple vectors (e.g., lists). |
MoreArgs |
A named list that specifies the scalar arguments (if any) to |
mdma.argIsMultiData |
Optional specification whether arguments are multiData structures. A logical vector where each component
corresponds to one entry of |
mdmaExistingResults |
Optional list that contains previously calculated results. This can be useful
if only a few sets in |
mdmaUpdateIndex |
Optional specification of which sets in |
mdmaSimplify |
Logical: should simplification of the result to an array be attempted? The simplification is fragile and
can produce unexpected errors; use the default |
returnList |
Logical: should the result be turned into a list (rather than a multiData structure)?
Note that this is incompatible with simplification: if |
mdma.doCollectGarbage |
Should garbage collection be forced after each application of |
mdmaVerbose |
Integer specifying whether progress diagnistics should be printed out. Zero means silent, increasing values will lead to more diagnostic messages. |
mdmaIndent |
Integer specifying the indentation of the printed progress messages. Each unit equals two spaces. |
A multiData structure is intended to store (the same type of) data for multiple, possibly independent,
realizations
(for example, expression data for several independent experiments). It is a list where
each component corresponds to an (independent) data set. Each component is in turn a list that can hold
various types of information but must have a 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).
This function applies the function FUN
to each data
component of those arguments in
...
that are multiData structures in the "loose" sense,
and to each component of those arguments in ...
that are
not multiData structures.
A multiData structure containing (as the data
components) the results of FUN
. If
simplification is successful, an array instead.
Peter Langfelder
multiData
to create a multiData structure;
multiData.apply
for application of a function to a single multiData structure.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.