Learn R Programming

rstream (version 1.3.7)

rstream.sample-methods: Methods for Function rstream.sample in Package `rstream'

Description

Get random sample from an "rstream" object in package rstream.

Usage

# S4 method for rstream,numeric
rstream.sample(stream,n=1)
# S4 method for rstream,numeric
r(stream,n=1)

Arguments

stream

an "rstream" object.

n

sample size.

Methods

Methods available for all "rstream" subclasses: rstream.mrg32k3a-class, rstream.runif-class.

Author

Josef Leydold josef.leydold@wu.ac.at

See Also

rstream.

Examples

Run this code
## create a new rstream object (of subclass rstream.mrg32k3a)
s <- new("rstream.mrg32k3a")

## get a random number
x <- rstream.sample(s)

## get a random sample of size 100
x <- rstream.sample(s,100)

## alternatively ...
x <- r(s,100)

Run the code above in your browser using DataLab