Mode: Calculate mode

Description Usage Arguments

View source: R/mode.R

Description

Calculates the mode, the most frequent value, of a variable x. This makes mostly sense for qualitative data. If there are more than one mode, all of them are returned in a vector. Modified from DescTools::Mode

Usage

1
Mode(x, na.rm = FALSE, multiple = FALSE)

Arguments

x

vector containing numeric information. To do: Modify to allow for character information!

na.rm

logical. Defaults to FALSE.

multiple

logical. Defaults to FALSE. If FALSE, return a vector containing ALL possible modes. If TRUE, function returns the 'mean' of the mode values for numeric vectors if the difference between the two modes is 1; if there are multiple differences or if the difference between two modes is > 1, then return NA to indicate that no 'numeric' mode can be imputed.


MHS-R/mhs documentation built on May 25, 2019, 12:23 p.m.