first_mode {clinpubr}R Documentation

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)

Arguments

x

A vector.

empty_return

The value to return if the vector is empty.

Value

The first mode of the vector.

Examples

first_mode(c(1, 1, 2, 2, 3, 3, 3, NA, NA, NA))

[Package clinpubr version 1.0.1 Index]