Skip to content
Prev 42886 / 398506 Next

generate random number of any given distribution

Hello, Yan: 

      Are you aware that for all the standard distributions, R provides 
the probability density, the cumulative distribution function, the 
quantile function, and random number generation?  When you said, 
"besides uniform and gaussian", I wondered.  The convention is that the 
first letter of the function is d, p, q, and r, for these 4 functions, 
followed by the name or abbreviation of the distribution.  Thus, rexp = 
random numbers for the exponential distribution, rbeta = beta r.n., rt = 
Student's t, rf = F distribution, etc. 

      hope this helps. 
      spencer graves
Liaw, Andy wrote: