library(devtools)
install_github("ryang73/rMLS")
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("ae34c71d")
team_stats(start_season = 2020, end_season = 2020,team_name="Columbus Crew SC")
fixtures(start_season = 2017,end_season = 2020)
# 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(start_season = 2020,end_season = 2020)
fte_matches(start_season=2017,end_season=2020)
fte_rankings()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.