I am a total beginner, and struggling to understand how to format the code to do what I want. I want to remove the lower test score (grouped by student_id and test_name) but I want to keep all of the other variables that I don't need to group by. I can't figure out how to do this. It goes from 21 columns to 3 columns.
You probably want to use the combination of group_by() and mutate(). This will compute the summary score (max value, for example) but not collapse the data.
Thank you! I then used distinct to select only the highest score. I am quite sure that I have sixteen lines of code when three would have worked. Sigh. Work in progress!