I have a dataframe that contains ratings for games and they are divided into categories and whether or not the game is a solo game or not.
category <- c("Party","Adventure","Puzzle","Party","Adventure","Puzzle","Party","Adventure","Puzzle","Party","Adventure","Puzzle","Party","Adventure","Puzzle","Party","Adventure","Puzzle")
solo <- c("solo","solo","solo","double","double","double","solo","solo","solo","double","double","double","solo","solo","solo","double","double","double")
rating <- c(8,7,6,5,3,3,2,1,10,3,4,5,6,3,2,1,3,1)
df <- as.data.frame(rating)
df$solo <- solo
df$category <- category
My question is, how do I get the average rating for each category that belongs to each grouping (solo/double)? Solo Party and Double Party should have different avg ratings for example.