calc_mode_binary: Calculate mode of a binary numeric vector

View source: R/calc_mode_binary.R

calc_mode_binaryR Documentation

Calculate mode of a binary numeric vector

Description

Calculate mode of a binary numeric vector

Usage

calc_mode_binary(x)

Arguments

x

A numeric vector consisting only of binary values (0 and 1).

Value

Returns a numeric vector representing the mode value. Returns 1 if there is a tie. Returns 'NA' if the vector is empty.

Examples

calc_mode_binary(c(0, 1, 1, 0, 1))

eventreport documentation built on March 11, 2026, 1:07 a.m.