I would like to generate a random number that is between 0 and 1 but that is NOT greater than .4 and less than .6. Is there any better way to do this in R than as follows?
sample(c(runif(1,0,.4), runif(1,.6,1)), 1, prob=c(.5,.5))
Aucun commentaire:
Enregistrer un commentaire