The goal of eplR is to make it easy for any user of R to access and analyze data from the English Premier League (soccer). The package provides R functions that simplify and expedite common tasks for studying match, referee and betting statistics in the league.
You can install the released version of eplR from Github with:
# Install eplR from Github
if (!require("devtools")) {
install.packages("devtools")
}
devtools::install_github("gl2668/eplR")
library(eplR)
The eplR
package comes with a built in dataset for 17 seasons of English Premier League (soccer) games. They are from 2002/2003 to 2018/2019. To call on the dataset just use call eplData
. The format of eplData
is a list of dataframes so to get the dataframe for 2002/2003 season use the following code:
# Get Data for season 2002/2003
eplData[[1]]
For an easier version to query the data. You can use the getData()
function. This function allows you to specify the season, whether you want additional betting information and whether you only want to have season data for a specific team.
# Query Data
getData(1617, bet = FALSE, team = "Liverpool")
For users who are interested in analysing the season statistics for referees, you can use the referee()
function, which will output a specialized query for referee-related information.
# Get Referee stats for 2013-2014 season
referee(1314)
To get summary statistics for a particular team during a particular season, use the teamData()
function.
teamData(1112, "Wolves")
To visualize the performance of a team over the course of a particular season, use the teamPerformance()
function.
# Look at the performance of Man City and Man United in the 2018-2019 season
teamPerformance(1819, "Man City")
teamPerformance(1819, "Man United")