Learn R Programming

eventreport (version 0.1.1)

calc_mode_binary: Calculate mode of a binary numeric vector

Description

Calculate mode of a binary numeric vector

Usage

calc_mode_binary(x)

Value

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

Arguments

x

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

Examples

Run this code
calc_mode_binary(c(0, 1, 1, 0, 1))

Run the code above in your browser using DataLab