Learn R Programming

eventreport (version 0.1.1)

calc_mode_numeric: Calculate mode of numeric vector

Description

This function calculates the mode of a given numeric vector, and returns the smallest mode value if multiple modes exist.

Usage

calc_mode_numeric(x)

Value

Returns a numeric vector representing the mode value. Returns the smallest mode value if multiple modes exist, and NA if the vector is empty or contains non-numeric elements.

Arguments

x

A numeric vector.

Examples

Run this code
calc_mode_numeric(c(1, 2, 2, 3, 4, 4))

Run the code above in your browser using DataLab