dunif(x, min = 0, max = 1, log = FALSE)
punif(q, min = 0, max = 1, lower.tail = TRUE, log.p = FALSE)
qunif(p, min = 0, max = 1, lower.tail = TRUE, log.p = FALSE)
> runif(20,min=-1,max=2)[1] -0.907921619 0.009767967 0.331209081 -0.242364699 0.444335947 [6] 1.991711407 -0.812969660 1.237642935 -0.088655771 0.519129887 [11] 0.590708634 0.743662685 0.964670761 0.179365808 0.439812715 [16] 0.140639431 -0.518143212 0.007242380 -0.291944764 0.213176991
For 0 <= x <= 1, dunif(x)=1; for x < 0 and x > 1, dunif(x) = 0;
> dunif(0)[1] 1 > dunif(1)[1] 1 > x <- seq(-1,2,by=0.01) > y <- dunif(x) > plot(x,y,col="green", type="l")
For 0 <= x <= 1, punif(x)=x; for x < 0, dunif(x) = 0; for x > 1, dunif(x) = 1;
> punif(0)[1] 0 > punif(1)[1] 1 > x <- seq(-1,2,by=0.001) > y <- punif(x) > plot(x,y,col="green", type="l")
> qunif(c(0.05,0.25,0.5,0.75))[1] 0.05 0.25 0.50 0.75