| Title: | An App to Manage and Organise Foosball Tournaments |
|---|---|
| Description: | A relational SQLite database used to manage foosball tournaments. This package provides a features and a graphical user interface to easily access the database. It also allows to visualise (historical) data and account player history. It can be used to facilitate a live tournament. |
| Authors: | Pepijn de Vries [aut, cre, dtc] (0000-0002-7961-6646) |
| Maintainer: | Pepijn de Vries <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.0.0.9023 |
| Built: | 2026-10-01 00:17:59 UTC |
| Source: | https://github.com/pepijn-devries/foosball3 |
Renders the Graphical User Interface and starts the server to interact with a Foosball SQLite database.
foosball3(...)foosball3(...)
... |
Ignored |
Returns NULL invisibly.
Creates an SQLite file at the specified location. It will contain all required relationships and constraints and some non-trivial data.
foosball3_create_db(file, ...)foosball3_create_db(file, ...)
file |
File path where the database needs to be stored |
... |
Ignored |
Returns NULL invisibly.
fl <- tempfile(fileext = ".sqlite") foosball3_create_db(fl) ## Clean up: unlink(fl, TRUE, TRUE)fl <- tempfile(fileext = ".sqlite") foosball3_create_db(fl) ## Clean up: unlink(fl, TRUE, TRUE)
Export a database to a collection of csv-files. Note that you will lose all views, relational information and constraints from the database.
foosball3_export_db(source, destination, validate = FALSE, ...)foosball3_export_db(source, destination, validate = FALSE, ...)
source |
File path, where the source SQLite database can be found |
destination |
File path, where the zipped collection of csv-files should be stored |
validate |
A |
... |
Ignored. |
NULL invisible
new_db <- tempfile() foosball3_create_db(new_db) new_export <- tempfile(fileext = ".zip") foosball3_export_db(new_db, new_export) ## Clean up the files created in this example unlink(new_db, TRUE, TRUE) unlink(new_export, TRUE, TRUE)new_db <- tempfile() foosball3_create_db(new_db) new_export <- tempfile(fileext = ".zip") foosball3_export_db(new_db, new_export) ## Clean up the files created in this example unlink(new_db, TRUE, TRUE) unlink(new_export, TRUE, TRUE)
Generates matches for a specific phase in a foosball tournament for a given set of participants.
foosball3_generate_matches( participants, tournament_type = "individual", tournament_phase = "qualification", options, progress, ... )foosball3_generate_matches( participants, tournament_type = "individual", tournament_phase = "qualification", options, progress, ... )
participants |
A |
tournament_type |
Type of tournament for which to render matches.
At the moment only |
tournament_phase |
The phase of the tournament. At the moment only
|
options |
Options used for generating the matches. It can be used to tweak the effort for balancing matches for player experience. For
The
|
progress |
A callback function for reporting progress. It needs to be a function that accepts 1 numeric argument. It is called by the generator, with a number between 0 and 1 indicating the progress of the process. |
... |
Ignored |
It returns a data.frame with three columns. Firstly, MATCH_ID
which is a unique integer identifier for each match. Secondly, PARTICIPANT_ID,
which is from the input participants, and indicates the participants enrolled
in the indicated match. Thirdly, POSITION_CODE, indicating where the
participant is positioned for each specific match: S1 = striker side 1,
D1 = defender side 1, S2 = striker side 2 and finally D2 = defender side 2.
participants <- dplyr::tibble( PARTICIPANT_ID = 5L:9L, QUALIFICATION_RATE = c(0.3, 0.5, 1, 1.3, 1.5) ) opts <- list( nsim = 100, revolutions = 2, weights = list( teamup = 1, opposing = 1, match_var = 1, match_bal = 1, match_bal_var = 1, match_bal_extr = 1, part_bal = 1, part_bal_var = 1, part_bal_extr = 1 ), seed = 0 ) foosball3_generate_matches( participants, options = opts)participants <- dplyr::tibble( PARTICIPANT_ID = 5L:9L, QUALIFICATION_RATE = c(0.3, 0.5, 1, 1.3, 1.5) ) opts <- list( nsim = 100, revolutions = 2, weights = list( teamup = 1, opposing = 1, match_var = 1, match_bal = 1, match_bal_var = 1, match_bal_extr = 1, part_bal = 1, part_bal_var = 1, part_bal_extr = 1 ), seed = 0 ) foosball3_generate_matches( participants, options = opts)
If you have an older file with tournament results, you can try to
import those results with this function. It will create a new copy
of the database (using foosball3_create_db()), making sure it
complies with the latest database scheme specification used by this package.
foosball3_import_db(file, target, ...)foosball3_import_db(file, target, ...)
file |
An SQLite file or a zipped collection of csv files (created
with |
target |
Target file path where the clean database will be stored. Existing files at this location may be overwritten. |
... |
Ignored |
Creates a new clean copy of the database. Returns NULL invisibly.
tf <- tempfile() export <- tempfile(fileext = ".zip") import <- tempfile() foosball3_create_db(tf) foosball3_export_db(tf, export) foosball3_import_db(export, import) # Clean up example files unlink(tf, TRUE, TRUE) unlink(export, TRUE, TRUE) unlink(import, TRUE, TRUE)tf <- tempfile() export <- tempfile(fileext = ".zip") import <- tempfile() foosball3_create_db(tf) foosball3_export_db(tf, export) foosball3_import_db(export, import) # Clean up example files unlink(tf, TRUE, TRUE) unlink(export, TRUE, TRUE) unlink(import, TRUE, TRUE)
foosball3
Call this function if foosball3_suggests_ok() returns FALSE.
This will install all suggested packages required to run the graphical
user interface (foosball3()).
foosball3_install_suggests(ignore = "mirai", update = TRUE, ...)foosball3_install_suggests(ignore = "mirai", update = TRUE, ...)
ignore |
A vector of packages to ignore. By default
|
update |
A |
... |
Arguments passed to |
invisible NULL
foosball3_suggests_ok()foosball3_suggests_ok()
foosball3 PackageThese are all packages required for the graphical user interface
(foosball3()).
Make sure that they are installed
foosball3_list_suggests(...)foosball3_list_suggests(...)
... |
Ignored |
Returns a vector of package names that are suggested by
foosball3 and required by its graphical user interface.
foosball3_list_suggests()foosball3_list_suggests()
Returns a list of tables and fields in the Foosball database. In addition, it contains a description of the table and each field.
foosball3_meta_data(...)foosball3_meta_data(...)
... |
Ignored. |
Returns a data.frame with description information
foosball3_meta_data()foosball3_meta_data()
This function returns TRUE if all packages required for the
graphical user interface (GUI) (foosball3()) are available.
foosball3_suggests_ok(ignore = "mirai", ...)foosball3_suggests_ok(ignore = "mirai", ...)
ignore |
A vector of packages to ignore. By default
|
... |
Arguments passed to |
A logical value, indicating of all required suggests are
available.
foosball3_suggests_ok()foosball3_suggests_ok()