DescTools (version 0.99.19)

Mode: Mode

Description

Calculates the mode, the most frequent value, of a variable x. This makes mostly sense for qualitative data.

Usage

Mode(x, na.rm = FALSE)

Arguments

x
a (non-empty) numeric vector of data values.
na.rm
logical. Should missing values be removed? Defaults to FALSE.

Value

See Also

mean, median

Examples

Run this code
data(d.pizza)
Mode(d.pizza$driver)

# use sapply for evaluating data.frames (resp. apply for matrices)
sapply(d.pizza[,c("driver","temperature","date")], Mode, na.rm=TRUE)

Run the code above in your browser using DataCamp Workspace