gapply {exams.forge}R Documentation

Apply Grid

Description

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.

Usage

gapply(FUN, ..., .simplify = TRUE)

apply_grid(FUN, ..., .simplify = TRUE)

Arguments

FUN

function or character: a string naming the function to be called

...

list: of arguments of the function to be called. The names attribute of args returns the argument names

.simplify

logical: should the result be simplified to a data frame (if possible)? (default: TRUE)

Value

A list or a data frame with the function results.

Examples

# 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))

[Package exams.forge version 1.0.10 Index]