[R] getting random integers

Erik Iverson eriki at ccbr.umn.edu
Thu Apr 29 18:47:03 CEST 2010



Hans Ekbrand wrote:
> I want 100 integers. Each integer, x, can be in the range 1 =< x => 10.
> 
> Does the following code give 1 and 10 the same chances to be selected as
> 2:8?
> 
> round(runif(100, min = 1, max = 10))

If you just want to sample integers, use ?sample



More information about the R-help mailing list