Learn R Programming

radiant.data (version 1.4.5)

modal: 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

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

Run the code above in your browser using DataLab