Determine the density of x (using the density function from stats) and then bin all points x using local minima as boundaries

find_density_minima(x, bw = NULL, print_plot = FALSE)

Arguments

x

a numeric vector

bw

the sd of the KDE smoother

print_plot

TRUE/FALSE print a plot showing

Value

a vector of integer group labels