Description Usage Arguments Details Value
Sample from a density object using rejection sampling
(this function is borrowed from splatter
).
1 | sampleDensity(n, dens, lower = 0)
|
n |
Number of values to sample |
dens |
Density object to sample from |
lower |
Lower x-axis bound on sampled values |
Random points (x and y) are generated inside the range of the density object.
If they value is less than the density for that x value (and x is greater
than lower
) then that x value is retained. Ten thousand points are
generated at a time until enough valid values have been sampled.
Vector of sampled values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.