Jump to ratings and reviews
Rate this book

The R Series

Analyzing Baseball Data with R

Rate this book
With its flexible capabilities and open-source platform, R has become a major tool for analyzing detailed, high-quality baseball data. Analyzing Baseball Data with R provides an introduction to R for sabermetricians, baseball enthusiasts, and students interested in exploring the rich sources of baseball data. It equips readers with the necessary skills and software tools to perform all of the analysis steps, from gathering the datasets and entering them in a convenient format to visualizing the data via graphs to performing a statistical analysis. The authors first present an overview of publicly available baseball datasets and a gentle introduction to the type of data structures and exploratory and data management capabilities of R. They also cover the traditional graphics functions in the base package and introduce more sophisticated graphical displays available through the lattice and ggplot2 packages. Much of the book illustrates the use of R through popular sabermetrics topics, including the Pythagorean formula, runs expectancy, career trajectories, simulation of games and seasons, patterns of streaky behavior of players, and fielding measures. Each chapter contains exercises that encourage readers to perform their own analyses using R. All of the datasets and R code used in the text are available online. This book helps readers answer questions about baseball teams, players, and strategy using large, publically available datasets. It offers detailed instructions on downloading the datasets and putting them into formats that simplify data exploration and analysis. Through the book’s various examples, readers will learn about modern sabermetrics and be able to conduct their own baseball analyses.

352 pages, Kindle Edition

First published October 29, 2013

22 people are currently reading
219 people want to read

About the author

Max Marchi

5 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
45 (47%)
4 stars
32 (33%)
3 stars
17 (17%)
2 stars
1 (1%)
1 star
0 (0%)
Displaying 1 - 3 of 3 reviews
Profile Image for Tim.
227 reviews177 followers
June 16, 2021
This is an amazing book!

I have a dog-eared, beaten up copy of the first edition. I've gone through it basically cover to cover twice, and used it many times as a reference. I believe this book is now on a second edition, which I haven't seen.

The book is geared towards people who are new to R, but I think even novice to intermediate level users of R will learn from the examples as well.

In addition to helping you learn R, you will learn where various data sources are for baseball info, and how to access it with some real examples. The book shows how to access each of: The Lahman Database (Season-by-Season data), Retrosheet data (game logs and play-by-play data which has outcomes of every pitch of every game for the last 100+ years) and Pitch f/x data (detailed data on every pitch since pitch f/x technology became available, showing things like velocity, movement, and location).

I think even if you are only a casual baseball fun, the book would be a fun way to learn R using real world examples and data.
9 reviews
July 10, 2023
R, matey! Haha jk, not really about the Pittsburgh Pirates! To be completely transparent, the book really gets in the weeds... and not in the good way!
1 review
September 10, 2019
This second edition is fully updated with tidyverse code! I loved the 2013 version of this text, so having it updated so quickly is a real treat.

Displaying 1 - 3 of 3 reviews

Can't find what you're looking for?

Get help and learn more about the design.