Learn R Programming

BLCOP (version 0.3.3)

sampleFrom: Sample from a distribution object

Description

Generates samples from a distribution held by an object of class distribution or mvdistribution. Intended mainly for internal use.

Usage

sampleFrom(dstn, n = 1)

Arguments

dstn

an object of class distribution or mvdistribution.

n

Number of samples to generate

Value

A vector or matrix of samples.

Examples

Run this code
# NOT RUN {
    x <- distribution("pois", lambda = 5)
    hist(sampleFrom(x, 1000), col = "blue", prob = TRUE)

# }

Run the code above in your browser using DataLab