I have a table that has a format along the lines of
user data
1234 42
1234 51
1234 50
1235 61
1235 55
I want to create a histogram of the average “data” based on user. In other words, I would like to combine rows of the table with the same userID and come up with an average for them. How would I do this on a large dataset?
Just use
tapply(assuming that your original data frame is nameddat):