Learn R Programming

algebraic.dist (version 0.9.1)

sampler.default: Sampler for non-dist objects (degenerate distributions).

Description

Sampler for non-dist objects (degenerate distributions).

Usage

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

Value

A function that takes n and returns n copies of x

Arguments

x

The object to sample from

...

Additional arguments to pass

Examples

Run this code
s <- sampler(5)
s(3)  # returns c(5, 5, 5)

Run the code above in your browser using DataLab