## 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")
Run the code above in your browser using DataLab