mercredi 10 mai 2017

Generate random numbers with rbinom but exclude 0s from the range

I need to generate random numbers with rbinom but I need to exclude 0 within the range.

How can I do it?

I would like something similar to:

k <- seq(1, 6, by = 1)

binom_pdf = dbinom(k, 322, 0.1, log = FALSE)

but I need to get all the relative dataset, because if I do the following:

binom_ran = rbinom(100, 322, 0.1)

I get values from 0 to 100.

Is there any way I can get around this?

Thanks




Aucun commentaire:

Enregistrer un commentaire