Learn R Programming

algebraic.dist (version 0.9.1)

sampler.lognormal: Sampler for a log-normal distribution.

Description

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

Usage

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

Value

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

Arguments

x

A lognormal object.

...

Additional arguments (not used).

Examples

Run this code
x <- lognormal(0, 1)
s <- sampler(x)
set.seed(42)
s(5)

Run the code above in your browser using DataLab