Suppose you have the following data:
a<-c(rep("agosto",3),rep("janeiro",4),rep("maio",6))
table(a)
I want to know which month with the least amount of comments?
With the function min(table(a))
the response is the minimum value and not the month with the least observations.
If you use the which.min()
function, you get the following result.
> which.min(table(a))
agosto
1
But what I need is to return only the category.