Learn R Programming

clinpubr (version 1.1.1)

first_mode: Calculate the first mode

Description

Calculate the first mode of a vector. Ignore NA values. Can be used if any mode is acceptable.

Usage

first_mode(x, empty_return = NA)

Value

The first mode of the vector.

Arguments

x

A vector.

empty_return

The value to return if the vector is empty.

Examples

Run this code
first_mode(c(1, 1, 2, 2, 3, 3, 3, NA, NA, NA))

Run the code above in your browser using DataLab