This project creates animated .gif plots in R for the 2025 MLB season and puts them in a Shiny wrapper.
This project scrapes baseball data, primarily wins and losses, over the course of the 2025 MLB season. Data from:
- baseball-reference.com
- teamcolorcodes.com
is used to create the final plots. As a result, there is always the possibility that the code to scrape the websites stops working.
The first plot shows a teams wins and their Pythagorean Winning Percentage over the course of the season. The second plot looks at how each teams' winning percent changed over the course of the season and how the associated confidence interval around the estimate shrank as more data became available.
- 01Scrape.R scrapes MLB and team color data, cleans it and saves it.
- 02Plot.R creates the animated .gif plots.
- 03Shiny.R wraps the animated plots in a Shiny app.
- Plots contains the plots for the Shiny app.
A detailed write-up of this project can be found here: https://ryanpapale.github.io/mlb2025.

