Calculations for a Football Prediction Competition
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
inst/image
man
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE.md
NAMESPACE
README.md
premPredictor.Rproj

README.md

premPredictor

premPredictor provides functions for running a football prediction competition for the Premier League.

In this particular competition, players need to predict the final table of a season before that season starts. Over the course of the season, the functions in this package show who has made the best prediction. In this case, 'best' is determined by the sum of squared differences between the actual standings of the teams and the player's predictions for those teams. The lower these differences, the better. A bonus (of -50 points) is also awarded for predicting the league winner.

Getting the predictions

To get the data from the players, I do the following:

  • Collate all predictions using this Google Form
  • Opt to get the results as a spreadsheet
  • Save the pertinent page of this spreadsheet as a csv file
  • Delete the email addresses from the csv file
  • Store this csv file in my public directory on Dropbox

Installation

You can install premPredictor from GitHub with:

# install.packages("devtools")
devtools::install_github("p0bs/premPredictor")

Example

I use the following code to track the standings in my competition:

library(premPredictor)
player_data <- get_player_data("https://www.dropbox.com/s/uin6zk4w5cyk2m1/PremPredict-18-19.csv")
get_latest_standings(data_input = player_data)

And this generates the following output: