| sampler | R Documentation |
It creates a sampler for the x object. It returns a function
that accepts a parameter n denoting the number of samples
to draw from the x object and also any additional parameters
... are passed to the generated function.
sampler(x, ...)
x |
the |
... |
additional arguments to pass |
A function that takes n and returns n samples.
x <- normal(0, 1)
samp <- sampler(x)
set.seed(42)
samp(5) # draw 5 samples from standard normal
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.