## Randomly generated data from the Zipf distribution.
set.seed(100)
x <- rzipf(n = 500, s = 2, N = 100)
hist(x, main = "Randomly Generated Data", prob = TRUE)
x.1 <- sort(x)
y <- dzipf(x = x.1, s = 2, N = 100)
lines(x.1, y, col = 2, lwd = 2)
plot(x.1, pzipf(q = x.1, s = 2, N = 100), type = "l",
xlab = "x", ylab = "Cumulative Probabilities")
qzipf(p = 0.20, s = 2, N = 100, lower.tail = FALSE)
qzipf(p = 0.80, s = 2, N = 100)
Run the code above in your browser using DataLab