I need to generate a certain number of random numbers starting from a sequence of integers and I use the following code: result<-sample(x=c(2:50), size=10e6, replace=T)
. I find that increasing the length of the result vector (up to a length of 10^6), the distribution of random numbers is not random if the length of the vector x
is an odd number. When plotting the histogram of result
I usually get that the 1st number of the sequence (in the example the '2') has a column (and so a number of elements) that is always higher than the other columns. If x=c(1:50)
, and so the length of x
is an even number, the behaviour of the random generator seems to be ok. Is there any issue about random number generators in R about this strange result? I use R 3.0.1 under Ubuntu 13.10.