I looked around the site, but I could not find this specific issue. I'm trying to prepare my dataset for further analysis, but I can't seem to fix something.
I have a list of Players and the club they currently play at:
PlayerID PlayerName CurrentClub
1 Roland Alberg ADO Den Haag
2 John Goossens Feyenoord
3 Michael de Leeuw Feyenoord
4 Kenny van der Weg NAC Breda
5 Alex Schalk NAC Breda
Where I want to get is:
NewID CurrentClub Player1 Player2
1 ADO Den Haag Roland Alberg NA
2 Feyenoord John Goossens Michael de Leeuw
3 NAC Breda Kenny van der Weg Alex Schalk
I've tried various methods with melt, group_by and transpose, but I never got it this result.
Does anybody know how to do this?