Learn R Programming

algebraic.dist (version 0.9.1)

sampler.empirical_dist: Method for obtaining the sampler for a empirical_dist object.

Description

Method for obtaining the sampler for a empirical_dist object.

Usage

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

Value

A function that takes n and returns n resampled observations.

Arguments

x

The object to obtain the sampler of.

...

Additional arguments to pass (not used).

Examples

Run this code
ed <- empirical_dist(c(10, 20, 30))
s <- sampler(ed)
set.seed(42)
s(5)

Run the code above in your browser using DataLab