get_mode: Get the mode of a factor or integer

View source: R/rt_ops.R

get_modeR Documentation

Get the mode of a factor or integer

Description

Returns the mode of a factor or integer

Usage

get_mode(x, na.exclude = TRUE, getlast = TRUE, retain.class = TRUE)

Arguments

x

Vector, factor or integer: Input data

na.exclude

Logical: If TRUE, exclude NAs

getlast

Logical: If TRUE, get

retain.class

Logical: If TRUE, output is always same class as input

Value

The mode of x

Author(s)

E.D. Gennatas

Examples

x <- c(9, 3, 4, 4, 0, 2, 2, NA)
get_mode(x)
x <- c(9, 3, 2, 2, 0, 4, 4, NA)
get_mode(x)
get_mode(x, getlast = FALSE)


egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.