To generate randomly distributed values in a single range, I use:
runif(number_of_numbers, lower_bound, upper_bound)
However, what if I want to generate randomly distributed values in two different intervals?
For example, I want to generate 100 random values between [-3,-2] and [2,3].
Is there an one-line elegant solution for that?
Aucun commentaire:
Enregistrer un commentaire