# NOT RUN {
data(havelaar)
n = 1000 # token size of text fragments
p = mean(havelaar$Frequency / n) # relative frequencies
plot(qbinom(ppoints(99), n, p), sort(havelaar$Frequency),
xlab = paste("quantiles of (", n, ",", round(p, 4),
")-binomial", sep=""), ylab = "frequencies")
lambda = mean(havelaar$Frequency)
ks.test(havelaar$Frequency, "ppois", lambda)
ks.test(jitter(havelaar$Frequency), "ppois", lambda)
# }
Run the code above in your browser using DataLab