-4

I am trying to find count how much time the same movid is played.

This is data I am using

Thanks to comments,

This is frequency of movie played

  > c<-head(table(B$movid),n=5)
  > head(as.data.frame(c),n=5)
      id Freq
  1    1  452
  2    2  131
  3    3   90
  4    4  209
  5    5   86

1. For this data, I would like to know how to +1 to frequency value for each id

This is rating data

  > d<-table(B$movid[B$rating>4])
  > head(as.data.frame(d),n=5)
      id Freq 
  1    1  119
  2    2    9
  3    3   11
  4    4   29
  5    5    6

2. After I find this proportion(d/c) as a vector matrix to create new matrix.

Thank you for your time and thank you for your help!

Kim
  • 9
  • 1
  • 3
  • I don't think this is a dupe as there are multiple questions in it. – akrun Sep 19 '16 at 08:36
  • 3
    Welcome to Stack Overflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). This will make it much easier for others to help you. – zx8754 Sep 19 '16 at 08:41
  • @Kim Please use `dput` to show the data instead of image as it is not possible to copy data from image. – akrun Sep 19 '16 at 09:10
  • @akrun, May I ask another comments for what I updated? Thank you! – Kim Sep 19 '16 at 10:04

1 Answers1

2

We can use table to find the frequency

table(df1$movid)

For the second question

length(unique(df1$movid[df1$rating>3.5]))
akrun
  • 874,273
  • 37
  • 540
  • 662