I am a novice R user and currently experimenting with some different functions in RStudio. I have a dataset (matchdb2017) with 13 variables. One variable, called Period.Name (factor), has two levels. These are ‘Quarter 1’ and ‘Quarter 2’. I’m trying to use dplyr to sum the values for Quarter 1 and Quarter 2 for each of the three numeric variables in my dataset. I want to group this by Player.Name, Session.Type and variable.
This is my code so far. I have not melted my dataset or reshaped to long format. Do I need to do this?
summary <- matchdb2017 %>%.
group_by(Player.Name, Session.Type, variable) %>%
I’m stuck with the next layer of code to sum Quarter 1 and Quarter 2 together, both levels of Period.Name. If someone has any suggestions, it would be very much appreciated.