Learn R Programming

algebraic.dist (version 0.9.1)

sampler.gamma_dist: Method for sampling from a gamma_dist object.

Description

Method for sampling from a gamma_dist object.

Usage

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

Value

A function that generates n samples from the gamma distribution

Arguments

x

The gamma_dist object to sample from

...

Additional arguments (not used)

Examples

Run this code
x <- gamma_dist(shape = 2, rate = 1)
s <- sampler(x)
set.seed(42)
s(5)

Run the code above in your browser using DataLab