Three codes were corrected for exercise 6. They are as follows:
In the second code: Since we want to find the number of movie reviews by year, we use the count function on the column year. This groups the rows by year and counts the unique values (in this case, movies).
We removed sort = TRUE as it is not required.
In the fourth code: we use add_count() as it counts group-wise and adds a new column. We named the new column 'n' in our code by adding name = 'n' as an argument for add_count().
Next, we want to filter the movies that have 5 reviews or under. So we added the filter function.
These are the corrections made exercise 6 Before
After
Before
After
Before
After