I need to calculate the majority vote for an item in R and I don\'t have a clue how to approach this.
I have a data frame with items and assigned categories. What I
If you have a function to calculate the mode, as in package prettyR, you can use aggregate:
prettyR
aggregate
require(prettyR) aggregate(d$category, by=list(item=d$item), FUN=Mode) # item x #1 1 2 #2 2 1