# NOT RUN {
# Unimodal distribution
x <- rbinom(100, size = 10, prob = 0.8)
## True mode
binomMode(size = 10, prob = 0.8)
## Most frequent value
mfv(x)
mlv(x, method = "discrete")
# Bimodal distribution
x <- rpois(100, lambda = 7)
## True mode
poisMode(lambda = 7)
## Most frequent value
mfv(x)
M <- mlv(x, method = "discrete")
print(M)
plot(M)
# }
Run the code above in your browser using DataLab