Learn R Programming

RVAideMemoire (version 0.9-32)

mod: Mode

Description

Compute the mode of a vector. The function makes the difference between continuous and discontinuous variables (which are made up of integers only).

Usage

mod(x)

Arguments

x
numeric vector.

See Also

density

Examples

Run this code
# Continuous variable
x <- rnorm(100)
mod(x)

# Discontinuous variable
y <- rpois(100,2)
mod(y)

Run the code above in your browser using DataLab