README.md

Travis build status

msf2

msf2 is an R wrapper for the MySportsFeeds API.

There is an official R package provided by MySportsFeeds, but this package differs in the following ways:

These additions have been very helpful for me to use the data effectively in R.

Install

devtools::install_github("dfs-with-r/msf2")

Usage

To start, make sure you have set the following environment variable set on your computer. You need to sign up for an account at MySportsFeeds then create an API key. Once you have this key, use the add_key() in this package to help show you what to do with it. For example, if your key was xxxyyyzzz you would do the following:

add_key("xxxyyyzzz")

Once you have done this you can query data easily. See the function documentation for a description of the parameters. They should follow the same parameters required to query the official web API.

library(msf)

# Get data
json <- game_boxscore("nba", "20171027-BRO-NYK", season = "2017-2018-regular")

# Or parse the json list into tidy dataframe
boxscore <- tidy(json)


zamorarr/msf2 documentation built on May 29, 2019, 11:46 a.m.