Learn R Programming

ggdistribute (version 1.0.3)

dmode: Mode from density estimation

Description

Finds the mode using the density function and then obtains the maximum value.

Usage

dmode(x, adjust = 1.5)

Arguments

x

Value vector. Numeric or integers.

adjust

Bandwidth adjustment. See density.

Examples

Run this code
# NOT RUN {
x <- rchisq(1000, 3)
hist(x, br=50)
abline(v = dmode(x), col = "red")
abline(v = median(x), col = "green")
abline(v = mean(x), col = "blue")
# }

Run the code above in your browser using DataLab