Uniform Distribution

DESCRIPTION:
Density, cumulative probability, quantiles and random generation for the uniform distribution.

USAGE:
dunif(x, min=0, max=1)
punif(q, min=0, max=1)
qunif(p, min=0, max=1)
runif(n, min=0, max=1)

REQUIRED ARGUMENTS:
x:
vector of quantiles. Missing values (NAs) are allowed.
q:
vector of quantiles. Missing values (NAs) are allowed.
p:
vector of probabilities. Missing values (NAs) are allowed.
n:
non-negative sample size. If length(n) is larger than 1, then length(n) random values are returned.

OPTIONAL ARGUMENTS:
min:
vector of lower limits. This is replicated to be the same length as p or q or the number of deviates generated.
max:
vector of upper limits (greater than lower limits). This is replicated to be the same length as p or q or the number of deviates generated.

VALUE:
density (dunif), probability (punif), quantile (qunif), or random sample (runif) for the uniform distribution on the range min to max.

SIDE EFFECTS:
The function runif causes creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

DETAILS:
Elements of q or p that are missing will cause the corresponding elements of the result to be missing. Missing values are allowed in min and max but result in NAs in the result and create a warning message.

BACKGROUND:
The uniform (or rectangular) distribution takes values equally likely from min to max. The uniform commonly models round-off error among other uses.

REFERENCES:
Johnson, N. L. and Kotz, S. (1970). Continuous Univariate Distributions, vol. 2. Houghton-Mifflin, Boston.

SEE ALSO:
set.seed , use sample to generate a uniform sample on integers or populations.

EXAMPLES:
x + runif(x)   # jitter the x data
runif(100, -1, 1) # 100 numbers uniform on -1 to 1