Mode: Mode

Description Usage Arguments Value Examples

View source: R/cleaners_helpers.R

Description

Calculate the mode of a set of values, for numeric or character/factor data. In ties, returns the first tied value.

Usage

1
Mode(x, na.rm = FALSE)

Arguments

x

A vector.

na.rm

Logical indicating whether NA values should be excluded.

Value

A vector of length 1 and the same class as x.

Examples

1
2
3
4
5
6
Mode(c(1,1,2,3))
Mode(c(1,2,2,3))
Mode(c(1,1,3,3))
Mode(c(3,3,1,1))
Mode(c(1,NA,NA))
Mode(c(1,NA,NA), na.rm = TRUE)

EcoGRAPH/epidemiar documentation built on Nov. 13, 2020, 5:31 p.m.