nstreams <- 10 # number of streams
names <- paste("mystream",1:nstreams,sep="")
.lec.CreateStream(names)
for (i in 1:nstreams) { # generate 10 RNs from each stream
old.kind <- .lec.CurrentStream(names[i])
print(paste("stream no.",i))
print(runif(10))
.lec.CurrentStreamEnd(old.kind)
}
Run the code above in your browser using DataLab