rattle (version 5.4.0)

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

Description

The mode is the most common or modal value of a list.

Usage

modalvalue(x, na.rm=FALSE)

Arguments

x

A vector, array or list.

na.rm

Whether to remove missing values.

Details

This function calculates the mode of a vector, array or list (lists are flattened). This code originated from an anonymous post on the R Wiki.