pulling element in column to make a dataframe

Hello, I'm new to R. I can't seem to pull elements in a column to make a counted data frame how many times the element appeared. Can someone help?

For instance:
I have two columns: timestamp and reaction.
In the reaction column, I have "LIKE","LOVE","HAHA","SORRY", and "ANGER".
I want to have all these counted and then set into a data frame with their perspective counts.

I think the function count from the dplyr package is what you are looking for. The code below (where d is your data.frame) will calculate the counts of each combinaiton of reaction and timestamp.

count(d, timestamp, reaction)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.