1

I want to add rows of data together based on criteria, but sequentially. So using the WorldFootballR package, I have data for players and I want to add player data together from game to game. For example I want playerX data from match 1 to be added to match in a new row then add that value to match 3 in a new row and so on and so forth for every individual player. How would I go about this?

devtools::install_github("JaseZiv/worldfootballR")
library(worldfootballR)

fb_player_urls("https://fbref.com/en/squads/fd962109/Fulham-Stats")
epl_2021_urls <- fb_match_urls(country = "ENG", gender = "M", season_end_year = 2021, tier="1st")
# function to extract EPL match results data
epl_2021 <- fb_match_results(country = "ENG", gender = "M", season_end_year = 2021, tier = "1st")
dplyr::glimpse(epl_2021)

test_urls_multiple <- c(epl_2021[[20]])

advanced_match_stats <- fb_advanced_match_stats(match_url = test_urls_multiple, stat_type = "possession", team_or_player = "player")
dplyr::glimpse(advanced_match_stats)
  
advanced_match_stats <-  advanced_match_stats[-c(15,18,22,23,24,25)]

advanced_match_stats <- advanced_match_stats[order(advanced_match_stats[,"Match_Date"], decreasing = FALSE),]

player_possession_stats <- advanced_match_stats[c(18,19,20,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42)]
> dput(head(advanced_match_stats, 90))
structure(list(League = c("Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League", 
"Premier League", "Premier League", "Premier League", "Premier League"
), Match_Date = c("2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", "2020-09-12", 
"2020-09-12"), Matchweek = c("Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)", "Premier League (Matchweek 1)", 
"Premier League (Matchweek 1)"), Home_Team = c("Fulham", "Fulham", 
"Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", 
"Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", 
"Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", 
"Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Crystal Palace", 
"Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
"Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
"Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
"Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
"Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
"Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
"Crystal Palace", "Crystal Palace", "Liverpool", "Liverpool", 
"Liverpool", "Liverpool", "Liverpool", "Liverpool", "Liverpool", 
"Liverpool", "Liverpool", "Liverpool", "Liverpool", "Liverpool", 
"Liverpool", "Liverpool", "Liverpool", "Liverpool", "Liverpool", 
"Liverpool", "Liverpool", "Liverpool", "Liverpool", "Liverpool", 
"Liverpool", "Liverpool", "Liverpool", "Liverpool", "Liverpool", 
"Liverpool", "West Ham United", "West Ham United", "West Ham United", 
"West Ham United", "West Ham United", "West Ham United", "West Ham United"
), Home_Formation = c("4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", 
"4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", 
"4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", 
"4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", 
"4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", 
"4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", 
"4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", 
"4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", 
"4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-3-3", 
"4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", 
"4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", 
"4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", 
"4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-3-3", "4-2-3-1", 
"4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1", "4-2-3-1"
), Home_Score = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0), Home_xG = c(0.1, 0.1, 0.1, 
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 1.1, 
1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 
1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 
2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 
2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 
2.7, 2.7, 1, 1, 1, 1, 1, 1, 1), Home_Goals = c("", "", "", "", 
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 
"", "", "", "", "", "", "", "", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Wilfried Zaha · 13&rsquor;", "Wilfried Zaha · 13&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"Mohamed Salah (P) · 4&rsquor; Virgil van Dijk · 20&rsquor; Mohamed Salah · 33&rsquor; Mohamed Salah (P) · 88&rsquor;", 
"", "", "", "", "", "", ""), Home_Yellow_Cards = c("2", "2", 
"2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", 
"2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", 
"2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", 
"2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", 
"2", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", 
"1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", 
"1", "1", "1", "2", "2", "2", "2", "2", "2", "2"), Home_Red_Cards = c("0", 
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"), Away_Team = c("Arsenal", 
"Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", 
"Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", 
"Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", 
"Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", 
"Arsenal", "Arsenal", "Arsenal", "Southampton", "Southampton", 
"Southampton", "Southampton", "Southampton", "Southampton", "Southampton", 
"Southampton", "Southampton", "Southampton", "Southampton", "Southampton", 
"Southampton", "Southampton", "Southampton", "Southampton", "Southampton", 
"Southampton", "Southampton", "Southampton", "Southampton", "Southampton", 
"Southampton", "Southampton", "Southampton", "Southampton", "Southampton", 
"Leeds United", "Leeds United", "Leeds United", "Leeds United", 
"Leeds United", "Leeds United", "Leeds United", "Leeds United", 
"Leeds United", "Leeds United", "Leeds United", "Leeds United", 
"Leeds United", "Leeds United", "Leeds United", "Leeds United", 
"Leeds United", "Leeds United", "Leeds United", "Leeds United", 
"Leeds United", "Leeds United", "Leeds United", "Leeds United", 
"Leeds United", "Leeds United", "Leeds United", "Leeds United", 
"Newcastle United", "Newcastle United", "Newcastle United", "Newcastle United", 
"Newcastle United", "Newcastle United", "Newcastle United"), 
    Away_Formation = c("3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", 
    "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", 
    "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", 
    "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", "3-4-3", 
    "3-4-3", "3-4-3", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", 
    "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", 
    "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", 
    "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", 
    "4-4-2", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", 
    "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", 
    "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", 
    "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", 
    "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-1-4-1", "4-4-2", 
    "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2", "4-4-2"), Away_Score = c(3, 
    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 
    3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 
    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 
    3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2), Away_xG = c(1.9, 
    1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 
    1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9, 
    1.9, 1.9, 1.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 
    0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 
    0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 
    0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 
    0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 1.6, 1.6, 
    1.6, 1.6, 1.6, 1.6, 1.6), Away_Red_Cards = c("0", "0", "0", 
    "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
    "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
    "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
    "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
    "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
    "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
    "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
    "0", "0", "0"), Team = c("Fulham", "Fulham", "Fulham", "Fulham", 
    "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", "Fulham", 
    "Fulham", "Fulham", "Fulham", "Fulham", "Arsenal", "Arsenal", 
    "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", 
    "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", "Arsenal", 
    "Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
    "Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
    "Crystal Palace", "Crystal Palace", "Crystal Palace", "Crystal Palace", 
    "Crystal Palace", "Southampton", "Southampton", "Southampton", 
    "Southampton", "Southampton", "Southampton", "Southampton", 
    "Southampton", "Southampton", "Southampton", "Southampton", 
    "Southampton", "Southampton", "Southampton", "Liverpool", 
    "Liverpool", "Liverpool", "Liverpool", "Liverpool", "Liverpool", 
    "Liverpool", "Liverpool", "Liverpool", "Liverpool", "Liverpool", 
    "Liverpool", "Liverpool", "Liverpool", "Leeds United", "Leeds United", 
    "Leeds United", "Leeds United", "Leeds United", "Leeds United", 
    "Leeds United", "Leeds United", "Leeds United", "Leeds United", 
    "Leeds United", "Leeds United", "Leeds United", "Leeds United", 
    "West Ham United", "West Ham United", "West Ham United", 
    "West Ham United", "West Ham United", "West Ham United", 
    "West Ham United"), Player = c("Aboubakar Kamara", "Aleksandar Mitrović", 
    "Ivan Cavaleiro", "Neeskens Kebano", "Andre-Frank Zambo Anguissa", 
    "Josh Onomah", "Bobby Reid", "Tom Cairney", "Harrison Reed", 
    "Joe Bryan", "Tim Ream", "Michael Hector", "Denis Odoi", 
    "Marek Rodák", "Alexandre Lacazette", "Eddie Nketiah", "Pierre-Emerick Aubameyang", 
    "Willian", "Nicolas Pépé", "Ainsley Maitland-Niles", "Granit Xhaka", 
    "Dani Ceballos", "Mohamed Elneny", "Héctor Bellerín", "Kieran Tierney", 
    "Gabriel Dos Santos", "Rob Holding", "Bernd Leno", "Jordan Ayew", 
    "Wilfried Zaha", "Jeffrey Schlupp", "Eberechi Eze", "James McCarthy", 
    "Luka Milivojević", "James McArthur", "Andros Townsend", 
    "Tyrick Mitchell", "Scott Dann", "Cheikhou Kouyaté", "Joel Ward", 
    "Vicente Guaita", "Danny Ings", "Che Adams", "Shane Long", 
    "Nathan Redmond", "Oriol Romeu", "James Ward-Prowse", "William Smallbone", 
    "Moussa Djenepo", "Ryan Bertrand", "Jan Bednarek", "Jannik Vestergaard", 
    "Jack Stephens", "Kyle Walker-Peters", "Alex McCarthy", "Roberto Firmino", 
    "Sadio Mané", "Mohamed Salah", "Georginio Wijnaldum", "Jordan Henderson", 
    "Curtis Jones", "Naby Keïta", "Fabinho", "Andrew Robertson", 
    "Virgil van Dijk", "Joe Gomez", "Trent Alexander-Arnold", 
    "Joël Matip", "Alisson", "Patrick Bamford", "Rodrigo", "Jack Harrison", 
    "Mateusz Klich", "Jamie Shackleton", "Pablo Hernández", 
    "Tyler Roberts", "Hélder Costa", "Kalvin Phillips", "Stuart Dallas", 
    "Pascal Struijk", "Robin Koch", "Luke Ayling", "Illan Meslier", 
    "Michail Antonio", "Pablo Fornals", "Sébastien Haller", 
    "Jarrod Bowen", "Felipe Anderson", "Mark Noble", "Andriy Yarmolenko"
    ), Min = c(62, 28, 90, 62, 28, 74, 16, 90, 90, 90, 90, 90, 
    90, 90, 86, 4, 90, 75, 15, 90, 78, 12, 90, 90, 90, 90, 90, 
    90, 90, 90, 80, 10, 73, 17, 90, 90, 90, 90, 90, 90, 90, 90, 
    84, 6, 90, 90, 90, 76, 14, 90, 45, 45, 90, 90, 90, 90, 90, 
    90, 90, 65, 25, 57, 33, 90, 90, 90, 88, 2, 90, 61, 29, 90, 
    80, 10, 61, 29, 90, 90, 90, 90, 90, 90, 90, 90, 66, 24, 88, 
    2, 66, 24), Touches_Touches = c(25, 8, 41, 30, 23, 30, 11, 
    79, 77, 69, 74, 74, 69, 28, 27, 1, 35, 36, 12, 49, 68, 20, 
    68, 71, 99, 120, 102, 34, 24, 25, 20, 13, 29, 16, 45, 38, 
    53, 38, 25, 45, 29, 23, 25, 4, 53, 87, 76, 27, 10, 84, 56, 
    51, 98, 99, 53, 51, 53, 75, 34, 44, 24, 40, 17, 69, 43, 61, 
    71, 1, 29, 15, 5, 43, 46, 5, 47, 14, 29, 70, 82, 80, 76, 
    85, 63, 36, 25, 11, 37, 4, 46, 25), `Att Pen_Touches` = c(2, 
    0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 3, 3, 2, 
    1, 2, 1, 2, 1, 1, 0, 0, 2, 2, 0, 2, 0, 0, 2, 1, 0, 4, 1, 
    0, 0, 7, 3, 1, 3, 0, 1, 0, 0, 1, 0, 2, 1, 2, 0, 6, 9, 19, 
    2, 0, 0, 4, 0, 2, 2, 0, 0, 0, 0, 2, 0, 2, 4, 0, 1, 0, 2, 
    0, 1, 0, 1, 0, 0, 8, 1, 4, 4, 0, 0, 1), Live_Touches = c(25, 
    8, 41, 30, 23, 30, 11, 79, 77, 69, 74, 74, 69, 28, 27, 1, 
    35, 36, 12, 49, 68, 20, 68, 71, 99, 120, 102, 34, 24, 25, 
    20, 13, 29, 16, 45, 38, 53, 38, 25, 45, 29, 23, 25, 4, 53, 
    87, 76, 27, 10, 84, 56, 51, 98, 99, 53, 51, 53, 73, 34, 44, 
    24, 40, 17, 69, 43, 61, 71, 1, 29, 15, 5, 43, 46, 5, 47, 
    14, 29, 70, 82, 80, 76, 85, 63, 36, 25, 11, 37, 4, 46, 25
    ), Att_Take_Ons = c(3, 1, 2, 2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 
    0, 1, 0, 2, 0, 1, 0, 0, 1, 0, 2, 0, 0, 2, 0, 5, 1, 0, 5, 
    0, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 1, 2, 1, 1, 0, 1, 1, 1, 
    1, 0, 1, 0, 2, 6, 14, 3, 1, 1, 1, 0, 2, 0, 2, 0, 0, 0, 0, 
    0, 3, 2, 1, 1, 0, 2, 1, 0, 0, 1, 2, 0, 4, 1, 0, 1, 0, 0, 
    0), Succ_Take_Ons = c(0, 1, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 
    0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 4, 1, 0, 
    2, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 
    1, 1, 0, 0, 0, 2, 5, 7, 1, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 
    0, 0, 3, 1, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 1, 1, 0, 1, 0, 
    0, 0), Succ_percent_Take_Ons = c(0, 100, 0, 100, 66.7, 100, 
    NA, NA, NA, NA, NA, NA, NA, NA, 100, NA, 50, NA, 0, NA, NA, 
    100, NA, 50, NA, NA, 100, NA, 80, 100, NA, 40, NA, NA, 100, 
    100, 0, NA, NA, NA, NA, 0, NA, 0, 50, 100, 0, NA, 100, 100, 
    100, 100, NA, 0, NA, 100, 83.3, 50, 33.3, 100, 0, 100, NA, 
    0, NA, 100, NA, NA, NA, NA, NA, 100, 50, 100, 0, NA, 100, 
    0, NA, NA, 0, 100, NA, 25, 100, NA, 100, NA, NA, NA), Tkld_Take_Ons = c(3, 
    0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 
    0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 
    0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 7, 
    2, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 
    1, 0, 0, 1, 0, 0, 3, 0, 0, 0, 0, 0, 0), Tkld_percent_Take_Ons = c(100, 
    0, 100, 0, 33.3, 0, NA, NA, NA, NA, NA, NA, NA, NA, 0, NA, 
    50, NA, 100, NA, NA, 0, NA, 50, NA, NA, 0, NA, 20, 0, NA, 
    60, NA, NA, 0, 0, 100, NA, NA, NA, NA, 100, NA, 100, 50, 
    0, 100, NA, 0, 0, 0, 0, NA, 100, NA, 0, 16.7, 50, 66.7, 0, 
    100, 0, NA, 100, NA, 0, NA, NA, NA, NA, NA, 0, 50, 0, 100, 
    NA, 0, 100, NA, NA, 100, 0, NA, 75, 0, NA, 0, NA, NA, NA), 
    Carries_Carries = c(17, 8, 32, 24, 16, 18, 3, 55, 46, 34, 
    42, 51, 42, 14, 17, 1, 27, 21, 9, 31, 38, 11, 47, 46, 66, 
    95, 72, 20, 22, 22, 9, 11, 4, 3, 12, 24, 14, 2, 6, 8, 13, 
    19, 21, 2, 37, 54, 43, 20, 6, 43, 41, 33, 65, 55, 37, 30, 
    44, 54, 21, 23, 21, 25, 8, 27, 25, 33, 31, 1, 15, 5, 1, 20, 
    16, 2, 28, 5, 18, 31, 35, 28, 41, 34, 35, 23, 11, 6, 19, 
    3, 29, 17), TotDist_Carries = c(86, 22, 188, 122, 111, 79, 
    5, 207, 192, 208, 143, 162, 179, 58, 89, 5, 196, 167, 57, 
    107, 187, 71, 201, 323, 325, 405, 287, 76, 91, 180, 50, 59, 
    9, 8, 35, 196, 52, 4, 31, 32, 116, 56, 32, 8, 158, 218, 166, 
    75, 35, 182, 273, 162, 383, 258, 169, 219, 329, 347, 138, 
    144, 99, 136, 39, 214, 204, 298, 121, 4, 54, 43, 2, 186, 
    89, 10, 75, 31, 221, 91, 153, 103, 188, 165, 190, 151, 92, 
    27, 186, 63, 164, 143), PrgDist_Carries = c(7, 6, 65, 42, 
    58, 27, 4, 103, 73, 106, 63, 85, 91, 28, 11, 5, 117, 94, 
    22, 35, 95, 45, 92, 230, 219, 211, 128, 41, 20, 89, 21, 31, 
    0, 2, 8, 97, 17, 0, 12, 13, 110, 16, 10, 0, 49, 152, 64, 
    35, 14, 100, 183, 107, 276, 152, 83, 71, 159, 205, 32, 74, 
    29, 80, 9, 47, 134, 161, 47, 4, 44, 18, 0, 118, 50, 2, 46, 
    28, 109, 22, 83, 53, 118, 84, 121, 58, 20, 1, 85, 49, 80, 
    67), PrgC_Carries = c(0, 0, 2, 4, 0, 0, 0, 1, 1, 2, 0, 0, 
    0, 0, 1, 0, 4, 4, 0, 0, 1, 1, 2, 8, 2, 0, 1, 0, 1, 3, 1, 
    1, 0, 0, 0, 4, 1, 0, 0, 1, 0, 1, 0, 0, 2, 1, 0, 2, 0, 1, 
    3, 0, 1, 4, 0, 2, 5, 8, 1, 2, 2, 3, 0, 1, 0, 1, 0, 0, 0, 
    2, 0, 4, 0, 0, 1, 0, 4, 0, 0, 0, 0, 1, 0, 2, 0, 0, 3, 2, 
    0, 4), Final_Third_Carries = c(2, 1, 3, 0, 0, 1, 0, 1, 0, 
    3, 0, 1, 1, 0, 0, 0, 1, 2, 2, 1, 1, 0, 3, 2, 2, 0, 1, 0, 
    1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 
    1, 0, 2, 0, 0, 0, 4, 1, 1, 2, 3, 1, 1, 0, 3, 0, 2, 1, 1, 
    1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 2, 0, 0, 1, 0, 0, 0, 2, 0, 
    0, 4, 1, 2, 2), CPA_Carries = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
    1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 
    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 4, 0, 0, 0, 1, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 
    0, 0, 0, 0, 1), Mis_Carries = c(3, 2, 4, 2, 0, 3, 2, 0, 0, 
    0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 2, 0, 0, 1, 0, 
    6, 5, 2, 0, 3, 0, 2, 3, 2, 0, 1, 0, 0, 4, 4, 0, 1, 0, 2, 
    1, 1, 1, 0, 1, 1, 3, 0, 3, 4, 5, 1, 0, 1, 2, 0, 1, 0, 1, 
    0, 0, 0, 0, 0, 4, 3, 1, 1, 0, 5, 3, 3, 0, 0, 1, 0, 2, 0, 
    0, 1, 0, 0, 0), Dis_Carries = c(2, 0, 0, 1, 1, 2, 0, 0, 0, 
    0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 
    13, 4, 2, 1, 0, 0, 0, 2, 1, 0, 0, 0, 0, 2, 0, 0, 3, 1, 0, 
    1, 0, 0, 0, 0, 0, 3, 0, 3, 3, 6, 2, 0, 2, 3, 0, 0, 0, 1, 
    1, 0, 0, 1, 0, 3, 0, 0, 0, 0, 2, 1, 1, 0, 0, 1, 0, 3, 0, 
    0, 2, 0, 1, 1), Rec_Receiving = c(18, 10, 33, 23, 17, 22, 
    6, 69, 65, 45, 55, 57, 46, 17, 23, 1, 32, 26, 8, 36, 48, 
    15, 59, 53, 75, 106, 86, 21, 22, 21, 14, 9, 7, 2, 13, 20, 
    16, 8, 4, 6, 6, 21, 22, 3, 38, 63, 47, 19, 5, 48, 42, 31, 
    68, 55, 30, 34, 43, 55, 25, 24, 19, 28, 7, 27, 26, 27, 26, 
    1, 16, 7, 0, 25, 27, 3, 36, 8, 15, 40, 46, 45, 48, 46, 34, 
    28, 12, 6, 26, 3, 39, 18), PrgR_Receiving = c(3, 2, 2, 7, 
    1, 1, 0, 2, 0, 5, 0, 0, 4, 0, 12, 0, 10, 5, 3, 4, 1, 0, 1, 
    9, 2, 0, 0, 0, 4, 10, 3, 1, 0, 0, 0, 3, 2, 0, 0, 1, 0, 9, 
    4, 1, 6, 0, 3, 5, 3, 10, 0, 0, 0, 9, 0, 8, 14, 16, 3, 1, 
    1, 4, 0, 6, 0, 1, 1, 0, 0, 2, 0, 5, 2, 1, 5, 2, 4, 1, 2, 
    0, 1, 0, 0, 12, 1, 1, 4, 0, 1, 6)), row.names = c(NA, -90L
), class = c("tbl_df", "tbl", "data.frame"))

https://www.dropbox.com/scl/fi/qvxcsj6ovb7t4h5mvlbvm/advanced_match_stats.csv?rlkey=j8o8dmyphb2d5df89oolo0qlj&dl=0

Mark
  • 7,785
  • 2
  • 14
  • 34
Takis
  • 11
  • 2
  • without minimal reprodicuble example (of your data, code so far, and desired output) I do not have the faintest idea where to begin... Please edit them into your question (see https://stackoverflow.com/a/5963610/6356278 if you do not know how to do this). With this information, you'll get better answer (faster), without it, this question might be closed. – Wimpel Aug 30 '23 at 07:50
  • @Wimpel is this sufficient? Im not certain how to add the dataset directly but I did add the code, hope this is ok – Takis Aug 30 '23 at 08:13
  • Hi Takis! Welcome to StackOverflow – Mark Aug 30 '23 at 09:44
  • What you have so far is good, in terms of code, but essentially the code is just running a scraper. It's best to include some data, and then ask people how to get a certain result, by providing a small example you have done by hand – Mark Aug 30 '23 at 09:51
  • e.g. I've been running this code for 30 minutes and it's still only 50% done – Mark Aug 30 '23 at 10:07
  • @Mark Ah ok thanks, I think someone added the output of the file for me. Basically I want to add the rows from "Min" to "PrgR_Receiving" for each individual player sequentially so I have an individual row for 1 game, 2 games, 3 games and so on. I would like to separate this into home and away but for now I'll just try to get it working initially – Takis Aug 30 '23 at 10:40
  • Takis it was me – Mark Aug 30 '23 at 10:41
  • so are you wanting a dataframe for each player, or a row for each player? – Mark Aug 30 '23 at 10:42
  • Perhaps a data frame for each player? Im thinking this because this current data frame is only 1 of I think 7 per player so it might get a bit messy trying to combine them without having their own dataframe, unless you recommend otherwise? – Takis Aug 30 '23 at 10:52
  • I don't see the use of `rbind` here, but it sounds like you want to incrementally add rows. Iteratively adding rows to a frame using `rbind(old, newrow)` works in practice but scales *horribly*, see "Growing Objects" in [The R Inferno](https://www.burns-stat.com/pages/Tutor/R_inferno.pdf). For each row added, it makes a complete copy of all rows in `old`, which works but starts to slow down a lot. It is far better to produce a list of these new rows and then `rbind` them at one time; e.g., `out <- list(); for (...) { out <- c(out, list(newrow)); }; alldat <- do.call(rbind, out);`. – r2evans Aug 30 '23 at 12:28
  • @r2evans I'm not too sure im understanding what each part of that means, as in, what would for example, "alldat" correlate to in regards to the data that im using? Or what would I put for list etc etc. Sorry, not very well versed at all my apologies – Takis Aug 30 '23 at 12:47
  • I really don't know tbh, I was latching onto your mention of "adding rows" and that it's 30min in and 50% done. A common symptom of "iterative rbinding" is that it goes quickly for a few minutes, but in each loop (adding more rows), it gets slower and slower. I don't know exactly if or how you are adding rows (I don't know this package), but the symptoms sound familiar. That's really all I know about this. – r2evans Aug 30 '23 at 13:58
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Aug 31 '23 at 06:06

0 Answers0