Reputation: 75
So we say that we are using a Movies dataset. We have 300 film names and each name has a release year. How do I count the number of films in a particular year?
movies.df %>%
count(film, year)
Upvotes: 0
Views: 945
Reputation: 583
You can try...
library(dplyr)
g <- group_by(movies.df, year)
summarise(g, length(year))
Upvotes: 0
Reputation: 145
So, thewal , you didnt show an example , and i am just suggesting you do the following which might be of some help
movies.df %>% group_by(year) %>% summarise(n=n())
This will count the number of films in a year
Upvotes: 2