I'm really sorry to ask this question again, because there are already many questions about this. However, none of the solutions worked for my problem.
My data looks like this:
id scale rater rating
1 A 1 5
1 B 1 7
1 A 2 3
1 B 2 6
2 A 1 4
2 B 1 3
2 A 2 2
2 B 2 1
I want to spread(rater, rating)
In the end it should look like this:
id scale 1 2
1 A 5 3
1 B 7 6
2 A 4 2
2 B 3 1
The problem obviously is that the rows in the first dataset don't have unique identifiers. Looking at answers to similar questions, none of the solutions seem to work for me. I can't just delete duplicate rows and when using row numbers or grouped identifiers group_by(id) %>%
mutate (grouped_id = row_number())
I don't get the two raters put in one column, but a row each with NA for the rating of the other rater.
I feel like I tried everything I could find and would really appreciate some help! Thank you very much in advance!