I have some data from a movie dataset as shown above with 2 columns - 'Genre' and 'IMDB Score'. There are 24 unique genres and 1,000s of rows, each with a different IMDB score attached to them. In the end, I want a dataframe with 24 rows, each row a genre and each genre attached with the mean IMDB score for that genre i.e.
**Genre IMDB Score**
1 Action mean IMDB score for 'action'
2 Adventure mean IMDB score for 'adventure'
3 Fantasy mean IMDB score for 'fantasy'
...
How would I go about coding this?
I'm really new at R, so am not at all sure how to do this.
Here are two ways to do it using data I invented. The apparent difference in precision of the two answers is just due to how the results are printed. The stored values are the same.