Given an order table and a schedule of points, calculate the points awarded to each competitor.

ordertable2points(o, points,totals=TRUE)

Arguments

o

Order table

points

A numeric vector indicating number of points awarded for first, second, third, etc placing

totals

Boolean, with default TRUE meaning to return the points for each player (row) and FALSE meaning to return the entire table but with orders replaced with points scored

Value

Returns either an order table or a named numeric vector

Author

Robin K. S. Hankin

See also

Examples


points <- c(25, 18, 15, 12, 10, 8, 6, 4, 2, 1, 0, 0)
o <- as.ordertable(F1_table_2017)
ordertable2points(o,points)
#>   Hamilton     Vettel     Bottas  Raikkonen  Ricciardo Verstappen      Perez 
#>        363        317        305        205        200        168        100 
#>       Ocon      Sainz Hulkenberg      Massa     Stroll   Grosjean  Magnussen 
#>         87         54         43         43         40         28         19 
#>     Alonso  Vandoorne     Palmer   Wehrlein      Kvyat   Ericsson      Gasly 
#>         17         13          8          5          5          0          0 
#> Giovinazzi    Hartley     Button      Resta 
#>          0          0          0          0 

ordertable2points(ranktable_to_ordertable(rrank(9,volvo_maxp)),1)
#>   AbuDhabi Alvimedica     Brunel   Dongfeng     MAPFRE        SCA     Vestas 
#>          3          0          0          2          3          0          1