mapply {base} | R Documentation |
A multivariate version of sapply
.
mapply
applies FUN
to the first elements of each ...
argument, the second elements, the third elements, and so on.
Arguments are recycled if necessary.
mapply(FUN, ..., MoreArgs = NULL, SIMPLIFY = TRUE, USE.NAMES = TRUE)
FUN |
Function to apply |
... |
Arguments to vectorise over (list or vector) |
MoreArgs |
A list of other arguments to FUN |
SIMPLIFY |
Attempt to reduce the result to a vector or matrix? |
USE.NAMES |
If the first ... argument is character and the result doesn't already have names, use it as the names |
A list, vector, or matrix.
mapply(rep, 1:4, 4:1) mapply(rep, times=1:4, x=4:1) mapply(rep, times=1:4, MoreArgs=list(x=42))