Counting the frequency of user activities - R

+4 votes

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?

Dec 3, 2019 in Data Analytics by anonymous
• 160 points
1,500 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

+5 votes
3 answers

Counting the frequency of unique values - R

Hi, You can use plyr module. It will give ...READ MORE

answered Dec 14, 2020 in Data Analytics by MD
• 95,460 points
98,472 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,660 points
5,890 views
0 votes
1 answer
0 votes
2 answers

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

The function match works on vectors : x <- sample(1:10) x # ...READ MORE

answered Dec 12, 2020 in Data Analytics by Rajiv
• 8,870 points
56,631 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,670 points
1,274 views
+1 vote
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, 2019 in Data Analytics by anonymous
• 33,030 points
13,026 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
1,661 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 5, 2018 in Data Analytics by Kalgi
• 52,350 points
1,099 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
1,919 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP