Learn R Programming

CORE (version 1.2)

advanceRNG:

Usage

advanceRNG(randopt = c("SIMPLE", "RESCALE"), nrand, nevents)

Arguments

randopt
nrand
nevents

Value

    Examples

    Run this code
    ##---- Should be DIRECTLY executable !! ----
    ##-- ==>  Define data, use random,
    ##--	or do  help(data=index)  for the standard data sets.
    
    ## The function is currently defined as
    function (randopt = c("SIMPLE", "RESCALE"), nrand, nevents) 
    {
        randopt <- match.arg(randopt)
        switch(randopt, SIMPLE = replicate(nrand, {
            a <- runif(2 * nevents)
            rm(a)
        }), RESCALE = replicate(nrand, {
            a <- sample(nevents)
            a <- runif(nevents)
            rm(a)
        }))
        return()
      }

    Run the code above in your browser using DataLab