mode_stat: Returns the mode of a vector.

View source: R/stat_funcs.R

mode_statR Documentation

Returns the mode of a vector.

Description

Determines the most common value in a vector. Handles multiple modes by returning a vector containing all modes. Works with any data type.

Usage

mode_stat(x, na.rm = FALSE, method = "tabulate")

Arguments

x

a vector

na.rm

a boolean indicating, if TRUE, removes NA values before calculating the mode

method

specifies the method used for determining the mode

Details

method must be one of either "tabulate" or "density." "Tabulate"

Value

a vector containing the modes of x


tomhopper/numbr documentation built on Nov. 5, 2022, 11:35 p.m.