[R] Random Integers

Andy Fugard a.fugard at ed.ac.uk
Sun Feb 25 15:27:57 CET 2007



On 25 Feb 2007, at 06:51, Anup Nandialath wrote:

>
> Is there an R function to generate random integers?  Thanks in  
> advance.

The package Random does what you want, but requires a net connection.

http://cran.r-project.org/src/contrib/Descriptions/random.html

"This package provides an interface to the true random number service  
provided by the random.org website created by Mads Haahr. The  
random.org web service samples atmospheric noise via radio tuned to  
an unused broadcasting frequency together with a skew correction  
algorithm due to John von Neumann."

install.packages("random")
library(random)
?random

 > randomNumbers(10,1,6,1)
    V1
1   5
2   3
3   6
4   3
5   3
6   1
7   6
8   4
9   5
10  3

Andy

--
Andy Fugard, Postgraduate Research Student
Psychology (Room F15), The University of Edinburgh,
   7 George Square, Edinburgh EH8 9JZ, UK
Mobile: +44 (0)78 123 87190   http://www.possibly.me.uk



More information about the R-help mailing list