By: Max Marchi and Jim Albert, CRC Press
Analyzing Baseball Data With R is an excellent book to learn R in a baseball context using RStudio.
The book provides exercises at the end of every chapter. This repository contains R scripts used in each exercise and necessary data files to be used. The information here will be updated to record completion of the exercises. These will be helpful if one becomes confused or stuck when trying to answer the problems. Also, in regards to the data used, it will be as up to date as possible.
##Organization of Files
There are four different folders contained in the master branch. These will have everything you need and some extra material that can help you.
This folder contains all the R script files of the exercises. The scripts are labled according to the associated exercise. An example of a file name is:
- Exercise 3-6.R
This corresponds to Exercise 6 of Chapter 3. The scripts can be opened into Rstudio. They can be used a reference or sourced if one wants to see what the exercise completed looks like.
This folder contains all the csv files that will be used to answer the end of chapter exercises.
This folder contains the differnt scatterplots, bar graphs, strike zones, etc that will be created in the exercises. The graphics are labled according to exercise and graph type. An example is:
- Exercise 3-5 Scatterplot.png
This contains the R data of completed exercises or chapters. It can be opened directly into Rstudio.
Analyzing Baseball Data With R
Sean Lehman's Baseball Archive http://www.seanlahman.com/baseball-archive/statistics/
Retrosheet http://www.retrosheet.org/#