This is a helper method used to return the dominant class of a classified variable. This is equivalent to median for a numeric variable.

dominant(x)

Arguments

x

character array, can also be a factor

Value

a 1-length character of the dominant class

Examples

dominant(sample(letters, 100, replace=T))
#> [1] "m"