mipply | R Documentation |
This function is a wrapper around sapply
that is invoked on the
data
slot of an object of mi-class
and / or on an object
of missing_data.frame-class
after being coerced to a
data.frame
mipply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE, columnwise = TRUE, to.matrix = FALSE)
X |
Object of |
FUN |
Function to call |
... |
Further arguments passed to |
simplify |
If |
USE.NAMES |
ignored but included for compatibility with |
columnwise |
logical indicating whether to invoke |
to.matrix |
Logical indicating whether to coerce each |
The columnwise
and to.matrix
arguments are the only additions to the argument list
in sapply
, see the Examples section for an illustration of their use. Note that
functions such as mean
only accept numeric
inputs, which can produce
errors or warnings when to.matrix = FALSE
.
A list, vector, or matrix depending on the arguments
Ben Goodrich and Jonathan Kropko, for this version, based on earlier versions written by Yu-Sung Su, Masanao Yajima, Maria Grazia Pittau, Jennifer Hill, and Andrew Gelman.
sapply
if(!exists("imputations", env = .GlobalEnv)) { imputations <- mi:::imputations # cached from example("mi-package") } round(mipply(imputations, mean, to.matrix = TRUE), 3) mipply(imputations, summary, columnwise = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.