R/resampling.R

Defines functions rDist plot.rDist

Documented in plot.rDist rDist

rDist <- function(x, ...) {
    d <- density(na.omit(x), ...)
    
    structure(function(n)
        rnorm(n = n,
              mean = sample(x = x, size = n, replace = TRUE),
              sd = d$bw),
              class = "rDist")
}
plot.rDist <- function(x, ...) {
    eval(expression(plot(d, ...)), envir = environment(x))
}

Try the rmngb package in your browser

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

rmngb documentation built on May 29, 2017, 9:22 p.m.