powered by
Sample from a density estimate
sample_from_density(x, n)
A sample with distribution close to x
A numeric variable from a (un)known distribution
Number of samples to return
x <- rnorm(1000) y <- sample_from_density(x, 1000) hist(x, breaks = 30, freq = FALSE, col = "grey", main = "Original data" )
Run the code above in your browser using DataLab