Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rstream.reset-methods

Methods for Function rstream.reset in Package ‘rstream’


Description

Reset "rstream" object in package rstream into its initial state.

By resetting the stream object the same stream of random numbers can be generated.

Usage

## S4 method for signature 'rstream'
rstream.reset(stream)

Arguments

stream

an "rstream" object.

Methods

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

Author(s)

See Also

Examples

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

## generate a sample
x <- rstream.sample(s,10)

## reset the stream object
rstream.reset(s)

## the new sample y is identical to x
y <- rstream.sample(s,10)
if (identical(x,y)) print("x and y are identical samples")

rstream

Streams of Random Numbers

v1.3.6
GPL-2
Authors
Josef Leydold <josef.leydold@wu.ac.at>
Initial release
2020-02-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.