R/multirandom.R

multirandom <-
function (n = 100, samples = 6, rdist = rnorm, ...) 
{
    DOTS <- list(...)
    rdist <- match.fun(rdist)
    RFUN <- function() {
        args = DOTS
        args$n = n
        do.call("rdist", args)
    }
    data.frame(value = c(replicate(samples, RFUN())), sample = rep(1:samples, 
        each = n))
}

Try the fastR package in your browser

Any scripts or data that you put into this service are public.

fastR documentation built on May 2, 2019, 5:53 p.m.