Counting the frequency of user activities - R

+1 vote

Within a data frame (see below), I would like to compute the frequency of each activity/event (see second column). The frequency of the events should be shown in the appropriate columns (third until sixth).

user  activity                              Open Docu     Read Docu     Edit Docu   Close Docu
1     c("Open Docu", "Close Docu",…)
2     c("Open Docu", "Read Docu",…)
3     c("Open Docu", "Close Docu",…)
4     c("Open Docu", "Edit Docu",…)

E.g. in column 3 (Open Document) and row 2 (user 1) should be written the number "1" and in column 6 (Close Document) should also be computed "1".

Or if user 4 edits a document five times, then "5" should be shown in column 5 (Edit Document) and row 5 (user 4).

How can I apply a loop-function (due to a massive amount of users) to count the frequency in each cell?

5 days ago in Data Analytics by anonymous
• 130 points
25 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Data Analytics

0 votes
2 answers

Counting the frequency of unique values - R

Try this, lapply(mtcars,function(x){ length(unique(x))}) READ MORE

answered Aug 20 in Data Analytics by anonymous
• 32,260 points
5,757 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,560 points
229 views
0 votes
1 answer
0 votes
1 answer

R function for finding the index of an element in a vector?

Yes, we can find the index of ...READ MORE

answered Apr 13, 2018 in Data Analytics by zombie
• 3,710 points
1,123 views
0 votes
1 answer

How can I control the size of points in an R scatterplot?

plot(variable, type='o' , pch=5, cex=.3) The pch argument ...READ MORE

answered May 3, 2018 in Data Analytics by shams
• 3,580 points
48 views
0 votes
2 answers

Locating row index of a column which has the maximum value - R

Hi, Nirvana You can also try this. which(iris$Sepal.Length == ...READ MORE

answered Aug 21 in Data Analytics by anonymous
• 32,260 points
145 views
+1 vote
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,720 points
135 views
0 votes
2 answers

In data frame how to spilt strings into values?

You can do this using dplyr and ...READ MORE

answered Dec 4, 2018 in Data Analytics by Kalgi
• 45,780 points
69 views
0 votes
1 answer
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
174 views