Learn R Programming

TouRnament (version 0.2.5)

roundrobin: Create a match schedule

Description

Create a match schedule according to the DFB's (German Soccer Association) 'harmonischer Schl<U+00FC>ssel-Plan 1-L' which is used as a blueprint for german football leagues.

Usage

roundrobin(teamvector, second_round = TRUE, match_free = TRUE,
  randomize = TRUE, seed)

Arguments

teamvector

A character vector of teams.

second_round

A logical value, indicating whether a second round with changed home and away team should be planned. Defaults to TRUE.

match_free

A logical value, indicating whether match free teams should be deleted from the schedule. Defaults to TRUE.

randomize

A logical value, indicating whether the team vector should be ordered randomly. Defaults to TRUE.

seed

A user defined integer to replicate the randomization process if randomize = TRUE.

Value

A data frame containing a match schedule including variables for matchday, home and away team.

Details

The applicability is currently restricted to a minimum of five teams.

References

https://portal.dfbnet.org/fileadmin/content/downloads/faq/211111_SZ_DFBnet_extern_mit_Gegenueberstellung4.pdf

Examples

Run this code
# NOT RUN {
require("engsoccerdata")
#get german Bundesliga teams from 1986
germany_1986 <- unique(engsoccerdata::germany[engsoccerdata::germany$Season==1986,"home"])
#replicable schedule
roundrobin(teamvector=germany_1986,second_round=TRUE,match_free=TRUE,randomize=TRUE,seed=1234)
#non replicable schedule
roundrobin(teamvector=germany_1986,second_round=TRUE,match_free=TRUE,randomize=TRUE)
# }

Run the code above in your browser using DataLab