← Back to all sparks
G

ggfootball

INFRA · APIS
Velocity0.0

Plotting Football Matches Expected Goals (xG) Stats with 'Understat' Data

A football-viz package just swapped scraping for an API and broke its own output to do it.

sports-analyticsr-packagedata-scrapingexpected-goalsbreaking-changesvisualization
Current state
ggfootball is a small R package for plotting expected-goals and shot data, sourced from Understat. Four releases are visible. The 0.2.x line was argument tidying and dependency pruning; 0.3.0 replaced the data-acquisition layer wholesale, moving get_match_shots() from HTML parsing onto Understat's AJAX endpoints and changing the returned column names in the process.
Where it's heading
The direction is away from scraped HTML and toward a thinner, more defensible package: four dependencies dropped in 0.3.0 on top of qdapRegex in 0.2.1, input validation added, error messages rewritten. Both breaking changes so far were accepted rather than deferred, which reads as a maintainer treating pre-1.0 as the window to get the shape right. The package is willing to break callers for structural reasons, not cosmetic ones.
Prediction
With the scraper rebuilt and the dependency surface trimmed, the next releases are likely to stabilise the new column names and extend the plotting side, which has seen nothing since 0.2.0. A 1.0 would be the signal that the data structure is now considered fixed.

Recent moves

  1. 6mo ago

    ggfootball 0.3.0

    ⚡ SPARK

    The release that redefines how the package gets its data: Understat is now read through AJAX API calls rather than parsed out of HTML, which changes get_match_shots()'s internal structure and column names. It is the structural move the earlier dependency pruning was heading toward.

    View source ↗
  2. 6mo ago

    ggfootball 0.2.2

    Graceful failure when internet resources are unavailable, added to satisfy CRAN's policy on packages that fetch remote data. Compliance work with no effect on what users can plot.

    View source ↗
  3. 1y ago

    ggfootball 0.2.1

    A single dependency, qdapRegex, removed. An early step in the dependency pruning that 0.3.0 later completed by dropping the rest of the HTML-parsing stack.

    View source ↗
  4. 1y ago

    ggfootball 0.2.0

    Argument cleanup on xg_chart(): background_color renamed to bg_color, the competition default emptied, and a new plot_bg_color for the surrounding plot area. Breaking, but confined to naming and defaults rather than behaviour.

    View source ↗