Skip to content

❗ This is a read-only mirror of the CRAN R package repository. ggfootball — Plotting Expected Goals (xG) Stats with 'Understat' Data. Homepage: http://aymennasri.me/ggfootball/ Report bugs for this package: https://github.com/aymennasri/ggfootball/issues

License

Notifications You must be signed in to change notification settings

cran/ggfootball

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ggfootball

It’s Football not Soccer.

Lifecycle: experimental

Overview

The ggfootball package provides R functions that scrape shots data from understat and visualizes it using interactive plots:

  • A detailed shot map displaying the location, type, and expected goals (xG) value of shots taken by both teams.
  • An xG timeline chart showing the cumulative expected goals for each team over time, annotated with the details of scored goals.

Installation

You can install ggfootball from CRAN with:

install.packages("ggfootball")

Example

library(ggfootball)

# xG chart
xg_chart(match_id = 26631, 
         home_team_color = "red", 
         away_team_color = "grey", 
         competition = "Premier League",
         bg_color = "#FFF1E5",
         plot_bg_color = "#FFF1E5")

# Shot/xG map
xg_map(match_id = 26631, title = "xG Map")

Acknowledgements

About

❗ This is a read-only mirror of the CRAN R package repository. ggfootball — Plotting Expected Goals (xG) Stats with 'Understat' Data. Homepage: http://aymennasri.me/ggfootball/ Report bugs for this package: https://github.com/aymennasri/ggfootball/issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages