This help topic is for R version 0.90. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/Uniform.html
Uniform {base}R Documentation

The Uniform Distribution

Description

These functions provide information about the uniform distribution on the interval from min to max. dunif gives the density, punif gives the distribution function qunif gives the quantile function and runif generates random deviates.

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)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations to generate.

min, max

lower and upper limits of the distribution.

See Also

.Random.seed about random number generation, rnorm, etc for other distributions.

Examples

u <- runif(20)
all(punif(u) == u) # T
all(dunif(u) == 1) # T

var(runif(10000))#- ~ = 1/12 = .08333
all(runif(100, 2,2) == 2)#-> TRUE [exhibits bug in R version <= 0.63.1]

[Package base version 0.90 ]