README.md

rMLS

Provides numerous functions for acquiring and analyzing major league soccer data. Data is acquired from various online resources and is molded into a tidy format to analyze in R.

Current Status: beta testing and development

Installation

library(devtools)  
install_github("ryang73/rMLS")

Overview

There are many great soccer packages available for both R and Python. What I discovered as I dug in though was a major gap in what was available specifically for MLS. Most packages only support the top European leagues. I initially wanted to mirror the availability of statistics, I quickly realized that Major League Soccer has so many more nuances to offer in a data package. Below is an outline of just a few, while full documentation can be found in each function.

Player Stats

player_stats("ae34c71d")

Team Stats

team_stats(start_season = 2020, end_season = 2020,team_name="Columbus Crew SC")

Fixtures

fixtures(start_season = 2017,end_season = 2020)

Box Scores

# one fixture
fix <- rMLS::fixtures()
box_score <- rMLS::box_scores(fix)

# many fixtures 
fix <- rMLS::fixtures(start_season=2015,end_season=2015)
box <- tibble::tibble()
for(i in 1:nrow(fix)){
  box_one_row <- rMLS::box_scores(fix,row=i)
  box <- dplyr::bind_rows(box,box_one_row)
}

Rosters

rosters(start_season = 2020,end_season = 2020)

Fivethirtyeight predictions

fte_matches(start_season=2017,end_season=2020)  
fte_rankings()

Stale Datasets

The following are datasets which are not updated in real time, but contains relevant information to Major League Soccer currently and historically.

Team Infomation

rMLS::team_info

Odds and Probabilities

rMLS::historical_odds

rMLS::current_odds

MLS Specific Rules

rMLS::designated_players

rMLS::homegrown_players

rMLS::salaries

rMLS::draft

Release Notes

Further Documentation



RyanG73/rMLS documentation built on July 24, 2021, 11:32 p.m.