gapply | R Documentation |
Runs all combinations of elements in ...
as parameters of FUN
(grid apply).
I(.)
can be used to avoid that an element is interpreted as a grid value.
If an error occurs, then the result of FUN
will not be stored. You may notice missing indices
in the returning list.
gapply(FUN, ..., .simplify = TRUE)
apply_grid(FUN, ..., .simplify = TRUE)
FUN |
function or character: a string naming the function to be called |
... |
list: of arguments of the function to be called. The |
.simplify |
logical: should the result be simplified to a data frame (if possible)? (default: |
A list or a data frame with the function results.
# 8 function calls: sum(1,3,5), sum(1,3,6), ..., sum(2,4,6)
gapply("sum", 1:2, 3:4, 5:6)
# 4 function calls: sum(1,3,5:6), sum(1,4,5:66), ..., sum(2,4,5:6)
gapply("sum", 1:2, 3:4, I(5:6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.