This is function determines the majority class of a vector (treated as factor).
Usage
majority(x)
Arguments
x
a vector.
Value
The factor level which occurs most often in x.
Details
This function treats the input vector as a factor and determines which level (class) of the factor is present most often. If two or more levels tie for majority then a random selection is made among the ties.