maketable: Make a league table

Description Usage Arguments Value Notes Examples

View source: R/maketable.R

Description

Make a league table

Usage

1
maketable(df = NULL, Season = NULL, tier = NULL, pts = 3)

Arguments

df

The results dataframe

Season

The Season

tier

The tier

pts

Points for a win. Default is 3.

Value

a dataframe with a league table

Notes

The table that is produced is based upon 3 points for a win (unless otherwise defined), 1 for a draw and 0 for a loss. The table is sorted based upon descending GD and then descending GF as tie-breakers. Different leagues have had different methods for tie-breaks over the years. This league table is a simple generic one. It also does not evaluate points deducted from teams or if games were artificially awarded to one side based on games not being played.

Examples

1
maketable(df=england,Season=2013,tier=1,pts=3)

Example output

                   team GP  W  D  L  gf ga  gd Pts Pos
1       Manchester City 38 27  5  6 102 37  65  86   1
2             Liverpool 38 26  6  6 101 50  51  84   2
3               Chelsea 38 25  7  6  71 27  44  82   3
4               Arsenal 38 24  7  7  68 41  27  79   4
5               Everton 38 21  9  8  61 39  22  72   5
6     Tottenham Hotspur 38 21  6 11  55 51   4  69   6
7     Manchester United 38 19  7 12  64 43  21  64   7
8           Southampton 38 15 11 12  54 46   8  56   8
9            Stoke City 38 13 11 14  45 52  -7  50   9
10     Newcastle United 38 15  4 19  43 59 -16  49  10
11       Crystal Palace 38 13  6 19  33 48 -15  45  11
12         Swansea City 38 11  9 18  54 54   0  42  12
13      West Ham United 38 11  7 20  40 51 -11  40  13
14           Sunderland 38 10  8 20  41 60 -19  38  14
15          Aston Villa 38 10  8 20  39 61 -22  38  15
16            Hull City 38 10  7 21  38 53 -15  37  16
17 West Bromwich Albion 38  7 15 16  43 59 -16  36  17
18         Norwich City 38  8  9 21  28 62 -34  33  18
19               Fulham 38  9  5 24  40 85 -45  32  19
20         Cardiff City 38  7  9 22  32 74 -42  30  20

engsoccerdata documentation built on May 2, 2019, 8:29 a.m.