dlog(1:20, 0.5)
rlog(20, 0.5)
prob <- 0.8; x <- 1:10
plot(x, dlog(x, prob = prob), type = "h", ylim = 0:1,
sub = "prob=0.8", las = 1, col = "blue", ylab = "Probability",
main = "Logarithmic distribution: blue=density; orange=distribution function")
lines(x + 0.1, plog(x, prob = prob), col = "orange", lty = 3, type = "h")
Run the code above in your browser using DataLab