Learn R Programming

exams.forge (version 1.0.10)

hyperloop: Hyperloop

Description

Runs a function several times with all parameter combinations, and checks:

  • if an argument is not a list, then it will be converted to an one element list

  • if an error occurs then the result of FUN will not be stored

Usage

hyperloop(FUN, ..., .simplify = FALSE)

hloop(FUN, ..., .simplify = FALSE)

Value

A hyperloop object as a list.

Arguments

FUN

function with named parameter(s)

...

named parameters which contain lists with possible parameter values

.simplify

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

Examples

Run this code
x   <- rnorm(100)
trm <- hyperloop(mean, x=list(x), trim=as.list(seq(0, 0.5, by=0.05)))
# automatic conversion of x to list(x)
trm <- hyperloop(mean, x=x, trim=as.list(seq(0, 0.5, by=0.05))) 
unlist(trm)

Run the code above in your browser using DataLab