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 #> 95 99 101 107 88 111 88 103 97 111
table(rdunif(1e3, 10, -5))
#> #> -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 #> 54 69 79 67 55 48 54 65 53 72 76 65 63 50 64 66