I have a set of fantasy football data that I am trying to figure out records from. The data is structured in the following way
team <- c("Mary", "John", "Matt","Paul","Mary", "John", "Matt","Paul")
week <- c(1,1,1,1,2,2,2,2)
opponent <- c("John", "Mary" , "Paul" , "Matt" , "Paul" , "Matt" , "John" , "Mary")
team.score <- c(10,15,6,7,8,12,2,3)
df <- data.frame(team,week,opponent,team.score)
head(df)
team week opponent team.score
Mary 1 John 10
John 1 Mary 15
Matt 1 Paul 6
Paul 1 Matt 7
Mary 2 Paul 8
John 2 Matt 12
What I would like to be able to do, is say Mary had a record of 1 - 1. I am not sure how to compare with the way the data is structured.