This week, Ellis Hughes and I deviate from our typical format and instead work on some code that Ben Baldwin shared with us. Ben is an analyst would does a lot of public facing NFL analysis, writes for The Athletic, and is co-creator of nflfastR, an R package for NFL play-by-play data.
Ben had some code that he shared on twitter where he was parsing an NFL play-by-play data from the data provider Sportradar. As he shared the code he lamented about it being a bit messy. We all have code that we wrote at one time that looks messy to us! Thus, we asked Ben if we could take the code and attempt to build a function that could process these files for any number of games.
We tackle this one totally live, having not looked at or discussed the code prior to hitting “record”. So, you get to watch us make mistakes and fumble around and learn along with us as we try to understand the data format and work up a solution in about an hour.
To watch the screen cast, CLICK HERE.
For our code, CLICK HERE.