| uniform | R Documentation | 
.lec.uniform generates U(0,1) random numbers.
.lec.uniform.int generates random numbers from the discrete uniform
distribution over integers.
.lec.uniform (name, n = 1)
.lec.uniform.int (name, n = 1, a = 0, b = 10)
| name | name of the stream. | 
| n | number of random numbers to be generated. | 
| a,b | interval from which the integer random numbers should be generated. | 
.lec.uniform and .lec.uniform.int, respectively, are wrapper functions for the C
functions RngStream_RandU01 and RngStream_RandInt, respectively (L'Ecuyer et al, 2002). 
Note: Since the stream is here identified by name, there is no need for using the CurrentStream pair.
A vector of n random numbers.
P. L'Ecuyer, R. Simard, E.J.Chen and W.D.Kelton: An Object-Oriented Random-Number Package With Many Long Streams and Substreams; Operations Research, vol. 50, nr. 6, 2002.
.lec.CurrentStream
nstreams <- 10       # number of streams
seed<-rep(1,6)
.lec.SetPackageSeed(seed)
names <- paste("mystream",1:nstreams,sep="")
.lec.CreateStream(names)
for (i in 1:nstreams)   # generate 10 RNs from each stream
      print(.lec.uniform(names[i],10))
.lec.DeleteStream(names)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.