ggfootball
0.3.0Plotting Football Matches Expected Goals (xG) Stats with 'Understat' Data
Overview
Scrapes football match shots data from 'Understat' https://understat.com/ and visualizes it using interactive plots: - A detailed shot map displaying the location, type, and xG value of shots taken by both teams. - An xG timeline chart showing the cumulative xG for each team over time, annotated with the details of scored goals.
- **BREAKING CHANGE**: Migrated Understat scraper from HTML parsing to AJAX API calls. This changes the internal data structure and column names returned by
get_match_shots(). - Added gzip decompression handling for compressed responses.
- Added input validation for match_id parameter.
- Fixed type conversion issues for numeric columns (minute, xG, goals, etc.).
- Improved error handling with clearer messages.
- Removed unused dependencies: rvest, stringi, stringr, readr.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 2
- Examples that run
- 0%2 never run
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 0
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Releases over time
7 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/aymennasri/ggfootball on 2026-10-11.
GitHub Pages site last deployed 2026-01-23 · The repository has a site deploy workflow
Dependencies
Installing ggfootball adds 93 packages (51 with compiled code, 85 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
People & History
Package metadata
- First published
- 2025-01-30
- Total releases
- 5 / 1 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 72 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("ggfootball")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.