Generate random samples from a discrete uniform distribution

rdunif(n, b, a = 1)

Arguments

n

Number of samples to draw.

a, b

Range of the distribution (inclusive).

Examples

table(rdunif(1e3, 10))
#> #> 1 2 3 4 5 6 7 8 9 10 #> 109 86 106 105 103 89 109 93 95 105
table(rdunif(1e3, 10, -5))
#> #> -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 #> 50 63 69 60 67 54 66 66 69 54 81 67 61 55 72 46