Here is my tutorial on web scraping data from FanGraphs.com. This is meant for experienced beginners and above. If you'd prefer, you can also just use the finished functions.
-
Part 1: Url Construction
- covers how to write a simple function that essentially "pastes" the parameters you want (i.e. types of splits) to create a custom query url in R.
-
Part 2: Data Acquisition and Cleaning
- covers using the function from part 1 to retrieve that data and make it usable
-
Part 3: Data Exploration
- various visualizations leading up to hypotheses
Out of respect for the site, please utilize write.csv
and read.csv
as much as possible!