Learn R Programming

datana (version 1.0.6)

moda: Computes the mode

Description

Computes the mode of a random variable.

Usage

moda(y = y)

Value

The function returns the mode, a numeric scalar.

Arguments

y

is a numeric vector.

Author

Christian Salas-Eljatib.

Details

The mode is an statistics representing the most "used" value of the random variable as a way of central position.

Examples

Run this code

set.seed(1234)
variable <- rnorm(10, mean=45,sd=6)
#using the function
moda(y=variable)
moda(variable)

Run the code above in your browser using DataLab