knitr::opts_chunk$set(echo = TRUE)
dfstools
is an R package for Daily Fantasy Sports (DFS) analytics, using the MySportsFeeds API and other data sources. The current release features functions that access the MySportsFeeds v2.0 API and save the tables to SQLite database files.
Install git, R and RStudio for your work environment. This is a developers' release; for the moment, you'll need to be familiar with git / GitHub, R and RStudio.
I test regularly on Windows 10 Pro, Arch Linux and the Data Science Pet Containers toolset, but any environment that supports RStudio Desktop or Server should work. If anything doesn't work or the documentation is unclear, please file an issue at https://github.com/znmeb/dfstools/issues/new/choose
2. Open RStudio. If you haven't already, install devtools
from CRAN.
3. In the RStudio console, type devtools::install_github("znmeb/dfstools")
.
dfstools
has are two classes of functions:
msf_
.sq_
.Note that there is limited support for Major League Baseball in version v1.0.0, for two reasons:
The next few releases will add:
msf_
functions for the current NBA, NHL and NFL seasons, andBut I do have some ideas for how to do DFS analytics beyond the projection / mixed integer-linear programming optimization approach currently popular. And there are two analytics features I know I'll be adding, at least for NBA:
mvglmmRank
, andAnthrompometry
.I have code for these in a private repository already and I know they give plausible results for NBA. I just need to integrate them with MySportsFeeds data.
And yes, I will be adding support for MLB as soon as I get the NBA analytics done.
Earlier versions of this package used the R wrapper provided by MySportsFeeds, https://github.com/MySportsFeeds/mysportsfeeds-r. I found I was spending so much time troubleshooting networking issues that I decided to write my own low-level routine, msf_get_feed
, and build my own API on top of that.
I decided to use SQLite for the database because both the R interface and the database administration process are much simpler than PostgreSQL or MySQL. The databases we're dealing with aren't big enough to require an industrial-strength relational database management system.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.