Learn R Programming

rattle (version 3.0.2)

modalvalue: Calculate the mode of a vector, array or list.

Description

The mode is the most common or modal value of a list. This function calculates the mode of a vector, array or list (lists are flattened).

Usage

modalvalue(x, na.rm=FALSE)

Arguments

x
A vector, array or list.
na.rm
Whether to remove missing values.

Details

Rattle needed this function, and R does not provide one. This version came from the R Wiki.

References

R Wiki: http://wiki.r-project.org/rwiki/doku.php?id=tips:stats-basic:modalvalue