Generate random sample 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 #> 96 100 105 75 102 105 113 107 90 107
table(rdunif(1e3, 10, -5))
#> #> -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 #> 64 52 62 61 64 55 57 67 58 67 57 80 62 58 68 68