I am picking my eyes out to figure this out on Friday night. My data looks like this
df <- data.frame(teamA=c("Italy","Italy","England","England"),
teamB=c("Germany","Greece","Germany","Greece"), win=c(0,1,1,1))
df
teamA teamB win
1 Italy Germany 0
2 Italy Greece 1
3 England Germany 1
4 England Greece 1
and I want transform it to a matrix that look like this. Preferably with dplyr but I am so desperate that does not matter
Italy England
Germany 0 1
Greece 1 1