rdiscunif: The Discrete Uniform Distribution

View source: R/rdiscunif.R

rdiscunifR Documentation

The Discrete Uniform Distribution

Description

Generate variates from a discrete uniform distribution.

Usage

 rdiscunif(n, min, max, steps)

Arguments

n

The number of points to be simulated. An integer.

min

The minimum value of the support of the distribution.

max

The maximum value of the support of the distribution.

steps

The step size in the support of the distribution i.e. the difference between consecutive values in the support. Must be positive and a factor of (max-min).

Details

rdiscunif generates a realisation of n points of the discrete uniform distribution with support (min,min+steps, min+2*steps,...,max). If steps is not a factor of (max-min); or if min > max then an error is generated. If min = max, then rdiscunif(n, min, max, steps)=repeat(min, n).

Value

A length n numeric vector containing realisations of the specified uniform distribution.

Author(s)

Tom Lawrence <email:tjlawrence@bigpond.com>

References

Lawrence, T.J. (2017) Master's Thesis, University of Western Australia.

See Also

Uniform for generating the continuous uniform distribution.

Examples

rdiscunif(n=10, min=0, max=5, steps=1)

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.