Skip to contents

Find modes in a multimodal distribution of values based on the density of such values.

Usage

find_modes(density)

Arguments

density

object of class density obtained using the function density.

Value

A data.frame containing the values corresponding to the modes and the density for those particular values.

Examples

# Data
data("dist_list", package = "biosurvey")

dens <- density(dist_list$`12`)

# Finding modes
modes <- find_modes(density = dens)
modes
#>         mode      density
#> 1   89131.98 1.470541e-06
#> 2  840589.96 1.278214e-06
#> 3 1614958.24 6.309926e-08