mosaic (version 0.8-1)

do: Do Things Repeatedly

Description

do() provides a natural syntax for repetition tuned to assist with replication and resampling methods.

Usage

do(n = 1L, cull = NULL, mode = NULL)

Arguments

n
number of times to repeat
cull
function for culling output of objects being repeated. If NULL, a default culling function is used. The default culling function is currently aware of objects of types lme, lm, htest, table,
mode
target mode for value returned

Value

  • do returns an object of class repeater which is only useful in the context of the operator *. See the examples.

See Also

replicate

Examples

do(3) * rnorm(1)
do(3) * "hello"
do(3) * lm(shuffle(height) ~ sex + mother, Galton)
do(3) * summary(lm(shuffle(height) ~ sex + mother, Galton))
do(3) * 1:4
do(3) * mean(rnorm(25))
do(3) * c(mean = mean(rnorm(25)))
do(3) * tally( ~sex|treat, data=resample(HELPrct))