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.
To get the data from the players, I do the following:
You can install premPredictor from GitHub with:
# install.packages("devtools")
devtools::install_github("p0bs/premPredictor")
I use the following code to track the standings in my competition:
library(premPredictor)
player_data <- get_player_data(
'https://www.dropbox.com/s/rr0qdtrhn4n4h9i/PremPredict-19-20-blank-emails.csv'
)
get_latest_standings(data_input = player_data)
… and this generates the following output:
> get_latest_standings(data_input = X)
Names Scores Bonus WorstClub WorstCost
1 Joe Wood 352 0 Sheff Utd 144
2 Peter Finnis 356 -50 Sheff Utd 169
3 Mike Finnis 406 -50 Sheff Utd 169
4 Andrea Laporta 414 -50 Sheff Utd 169
5 Robin Penfold 424 0 Sheff Utd 169
6 Imogen Finnis 434 0 AFC Bournemouth 100
7 Luke Finnis 434 0 Aston Villa 81
8 Mathew Saunders 438 0 Sheff Utd 144
9 John Penfold 498 0 Sheff Utd 169
10 Alan Finnis 514 0 Sheff Utd 121
11 Alan Butcher 516 -50 Sheff Utd 169
12 Marion Finnis 518 0 Sheff Utd 169
13 Hannah Harrop 526 0 Sheff Utd 169
14 Neil Waterman 526 0 Sheff Utd 169
15 Vera Finnis 544 -50 Leicester 196
16 Les Penfold 546 0 Sheff Utd 144
17 Beth Penfold 604 0 Leicester 196
18 Liz Penfold 668 -50 Wolves 144
19 Paula Penfold 684 0 Leicester 169
20 Scott Harrop 764 0 Sheff Utd 169
21 Laura Finnis 786 -50 Wolves 196
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.