gapply: gapply

View source: R/hyperloop.R

gapplyR Documentation

gapply

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 note missing indices in the returning list.

Usage

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

Arguments

FUN

fucntion or character: string naming the function to be called

...

list: arguments to the function call. The names attribute of args gives 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))

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.