Skip to contents

The number of modes a dataset has. It can be used to identify whether a dataset is unimodal, bimodal, or multimodal.

Usage

calc_modality(x)

Arguments

x

A vector

Value

A single value.

Examples


table(mtcars$cyl)
#> 
#>  4  6  8 
#> 11  7 14 

calc_mode(mtcars$cyl)
#> [1] 8

calc_modality(mtcars$cyl)
#> [1] 1