modal: Calculate the mode (modal value) and return a label

modalR Documentation

Calculate the mode (modal value) and return a label

Description

Calculate the mode (modal value) and return a label

Usage

modal(x, na.rm = TRUE)

Arguments

x

A vector

na.rm

If TRUE missing values are removed before calculation

Details

From https://www.tutorialspoint.com/r/r_mean_median_mode.htm

Examples

modal(c("a", "b", "b"))
modal(c(1:10, 5))
modal(as.factor(c(letters, "b")))
modal(runif(100) > 0.5)


radiant-rstats/radiant.data documentation built on Jan. 19, 2024, 12:21 p.m.