sample_mode: Sample Mode

Description Usage Arguments Value Author(s) Examples

View source: R/sample_mode.R

Description

Generic function for the arithmetic mode.

Usage

1

Arguments

x

A numeric/character vector.

Value

This function returns the element in x with the highest frequency. If there are more than one values with the highest frequency, it returns the first one (smallest one for numeric vector or character vector in alphabetical order).

Author(s)

Xiaojing Ni

Examples

1
2
sample_mode(c(1,2,2,3,3))
sample_mode(c("a","b","a"))

zhicongz/AnomDetct documentation built on Dec. 12, 2019, 9:16 a.m.