dimanche 21 février 2016

how to random generate numbers in R with space at least 10 apart?

for example, I wanna generate 100 numbers from 1 to 100,000, but the space between each is at least 10.

what should i do?

I know one way is to divide 100,000 by 10, and do the sample(1000,100) and get the answer, times 10, but I find that the numbers I get all end with 0

what if i want the "real" random numbers not only ending with 0. what should i do ? Thank you




Aucun commentaire:

Enregistrer un commentaire