rlply {plyr}R Documentation

Replicate expression and return results in a list

Description

Evalulate expression n times then combine results into a list

Usage

rlply(.n, .expr, .progress = "none")

Arguments

.n number of times to evaluate the expression
.expr expression to evaluate
.progress name of the progress bar to use, see create_progress_bar

Details

This function runs an expression multiple times, and combines the result into a list. If there are no results, then this function will return a list of length 0 (list()). This function is equivalent to replicate, but will always return results as a list.

@keyword manip @arguments number of times to evaluate the expression @arguments expression to evaluate @arguments name of the progress bar to use, see create_progress_bar @value list of results

Value

list of results

Author(s)

Hadley Wickham <h.wickham@gmail.com>

Examples

mods <- rlply(100, lm(y ~ x, data=data.frame(x=rnorm(100), y=rnorm(100))))
hist(laply(mods, function(x) summary(x)$r.squared))

[Package plyr version 0.1.9 Index]