I have an existing data frame with these columns. The home teams played against the Away Team in the sequence mentioned. In Results column H denotes that Home Team won, P denotes AwayTeam won and D denotes that it was a draw.
HomeTeam = Liverpool, Brighton, Birmingham, Manchester, Portsmouth
Away Team = Netherland, Austria, Cambodia, Netherlands, Austria
Results = H,H,P,D,H
My new data frame consists of column 'TeamName' where it shows the total number of teams playing the series.
TeamName = Liverpool, Brighton, Birmingham, Manchester, Netherland, Austria, Cambodia, Portsmouth
I want to add a column in the new data frame named 'Record' that record as wins, losses and ties for each team.
I am new in R so any help will be great! Thanks!