stat_mode: Returns mode of a variable

Description Usage Arguments Value Source Examples

View source: R/stat_mode.R

Description

This function takes a vector and returns the statistical mode, i.e. the most common value the vector takes.

Usage

1

Arguments

x

vector.

Value

Most common value.

Source

https://stackoverflow.com/questions/2547402/is-there-a-built-in-function-for-finding-the-mode

Examples

1
2
3
4
stat_mode(ggplot2::mpg$manufacturer)
stat_mode(ggplot2::mpg$model)

stat_mode(rpois(100, 1))

EmilHvitfeldt/ehlib documentation built on Aug. 15, 2021, 12:34 a.m.