Returns a function that draws n independent samples from the log-normal distribution.

# S3 method for class 'lognormal'
sampler(x, ...)

Arguments

x

A lognormal object.

...

Additional arguments (not used).

Value

A function function(n = 1, ...) returning a numeric vector of length n.

Examples

x <- lognormal(0, 1)
s <- sampler(x)
set.seed(42)
s(5)
#> [1] 3.9391243 0.5685317 1.4378205 1.8829931 1.4982059