rDist uses the density function to compute a gaussian kernel density estimation of x. Additional arguments can be passed to density through ....
It returns a function that can be used to generate random values from this estimated density.
It is also possible to have a look at the kernel density estimate by calling plot on the returned function.
x <- c(rnorm(100), rnorm(100, 4))
rTest <- rDist(x)
plot(rTest) # look at the estimaterTest(10) # generate random values from the estimatehist(rTest(1e3)) # density of randomly generated values