rdunif: Generate random sample from a discrete uniform distribution

Description Usage Arguments Examples

View source: R/utils.R

Description

Generate random sample from a discrete uniform distribution

Usage

1
rdunif(n, b, a = 1)

Arguments

n

Number of samples to draw.

a, b

Range of the distribution (inclusive).

Examples

1
2
table(rdunif(1e3, 10))
table(rdunif(1e3, 10, -5))

Example output

  1   2   3   4   5   6   7   8   9  10 
 99 108 107 118  92  86 103 101  87  99 

-5 -4 -3 -2 -1  0  1  2  3  4  5  6  7  8  9 10 
67 67 54 54 59 59 62 65 59 73 73 65 68 45 59 71 

purrr documentation built on April 19, 2020, 4:17 p.m.