Compute the Value of Quantile Function over Uniform Distribution in R Programming – qunif() Function
In R programming, qunif()
function gives the value of quantile function over Uniform Distribution.
Syntax:
qunif(p, min, max, lower.tail = TRUE, log.p = FALSE)
Parameters:
p: represents probabilities vector
min, max: represents lower and upper limits of the distribution
lower.tail: represents logical value. If TRUE, probabilities are P[Xx]
log.p: represents logical value. If TRUE, probabilities are given as log(p)
Example 1:
x <- seq (0, 1, by = 0.2)
qunif (x, min = 2, max = 6)
|
Output:
[1] 2.0 2.8 3.6 4.4 5.2 6.0
Example 2:
x <- seq (0, 1, by = 0.02)
y <- qunif (x, min = 1, max = 5)
png (file = "qunifGFG.png" )
plot (y, type = "o" )
dev.off ()
|
Output:
Last Updated :
03 Jul, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...