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 need two columns in the new data frame 'HomeRec' and 'AwayRec' that records the matches won by these teams at home and away.