Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calc_mode

Calculate mode


Description

Calculates the mode of a given vector.

Usage

calc_mode(x)

Arguments

x

Any kind of vector — numeric, character, logical.

Value

The mode(s) of that vector.

Examples

calc_mode(c(1, 1, 2, 3, 4))
calc_mode(c('the', 'quick', 'brown', 'fox', 'jumped', 'over', 'the', 'lazy', 'dog'))
calc_mode(c(TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE))

upstartr

Utilities Powering the Globe and Mail's Data Journalism Template

v0.1.1
MIT + file LICENSE
Authors
Tom Cardoso [aut, cre] (creator and maintainer), Michael Pereira [ctb], The Globe and Mail Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.