Skip to contents

This function takes a vector as input and returns the most frequent category or value. It works by converting the input into a table of frequencies, sorting the frequencies in descending order, and returning the most common value as a character string.

Usage

mostFrequent(x)

Arguments

x

A vector of values (e.g., categorical or character data).

Value

A character string representing the most frequent value in the input vector.