[This article was first published on Data Science Riot!, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
My original motivation to write the baseballDBR package for R was to provide a quick and easy way to have access to Sean Lahman’s Baseball Database. The Lahman package has been around for several years, and is a great resource, however it lacks consistant updates. Also, the CRAN repository has limits on how large data packages can be, and the Lahman package is currently pushing that limit.
The answer was an “open-data” format that is maintained by the Chadwick Bureau’s Baseball Databank, which is based on Sean Lahman’s database, version 2015-01-24, but has additinal tables aggregated from Retrosheet data.
For further details, see the GitHub page for the baseballDBR package. In the meantime, we’ll spin through a few lines of code that will quickly get us up and running.
The following is based on the assumption we have an empty Postgres database called “lahman.” If you prefer another database, the following method should also work with MySQL and the RMySQL package.
To leave a comment for the author, please follow the link and comment on their blog: Data Science Riot!.