get_mode: Calculates the mode(s) of a set of values

View source: R/get_mode.R

get_modeR Documentation

Calculates the mode(s) of a set of values

Description

This function calculates the most common value(s) of a given set

Usage

get_mode(x, moden = 1, quiet = FALSE)

Arguments

x

A variable or vector (numeric, character or factor)

moden

If there are multiple modes, which mode to use. The default is the first mode.

quiet

By default, messages are printed if multiple modes are selected. To hide these messages, set quiet to TRUE

Value

A vector of length 1 containing the mode

Examples

get_mode(trial$stage)
get_mode(trial$trt)
get_mode(trial$response)
get_mode(trial$grade)

ddsjoberg/bstfun documentation built on Feb. 2, 2023, 2:39 a.m.