knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
An R package for building and scheduling tournaments.
Build your very own tournament!
library(tournamentbuildr) # build a round-robin tournament x <- Tournament$new(teams = LETTERS[1:8], type = "round_robin") # view the schedule x$schedule
Once created, you can also record the results and track progress.
# play the first few games x$play(game = 1, winner = "A") x$play(game = 2, winner = "A") x$play(game = 3, winner = "D") # playing is chainable, cool! x$play(4, "A")$play(5, "F")$play(6, "G") # how do things stand now? x$standings()
Right now, you can choose from these types of tournaments:
- round-robin (round_robin
)
- random-robin (random_robin
)
- single-elimination bracket (bracket
)
Note that for the single-elimination tournament, teams are assumed to be pre-ranked and ordered from best-to-worst.
# round-robin Tournament$new(teams = LETTERS[1:8], type = "round_robin") # random-robin (i.e., a round-robin that's been cut short!) Tournament$new(teams = LETTERS[1:8], type = "random_robin", n_games = 10) # single-elimination bracket Tournament$new(teams = LETTERS[1:8], type = "bracket")
Given some restrictions on necessary equipment and availability of facilities, how should tournament games be scheduled?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.