Learn R Programming

algebraic.dist (version 0.9.1)

sampler.poisson_dist: Sampler for a Poisson distribution.

Description

Returns a function that draws n independent samples from the Poisson distribution.

Usage

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

Value

A function function(n = 1, ...) returning an integer vector of length n.

Arguments

x

A poisson_dist object.

...

Additional arguments (not used).

Examples

Run this code
x <- poisson_dist(5)
s <- sampler(x)
set.seed(42)
s(5)

Run the code above in your browser using DataLab