Getting the Most Frequent Categorical Values

Sometimes, you might want to get the most frequent categorical value for each group.

I have written how to do such by writing a simple R custom function.