Combine goals (type == “penalty”) with shootouts from matches .
library(dplyr) # Query disciplinary records alongside player details player_cards <- bookings %>% left_join(players, by = "player_id") %>% left_join(matches, by = "match_id") %>% group_by(player_name, team_name) %>% summarize( yellow_cards = sum(card_color == "yellow"), red_cards = sum(card_color == "red"), .groups = "drop" ) %>% arrange(desc(red_cards), desc(yellow_cards)) head(player_cards, 10) Use code with caution. Data Visualization Workflow jfjelstul worldcup r package
The package is primarily hosted on GitHub. You can install it directly using devtools : Combine goals (type == “penalty”) with shootouts from
# View the results team_goals
Here's an example:
: Comprehensive group stage tables tracking points, goal differentials, and goal metrics. 3. Squad and Player Entities by = "player_id") %>% left_join(matches