Description Usage Arguments Value Further details Examples
View source: R/randomtourney.R
Generates a randomized tournament with random outcomes
1 | randomtourney(n, matchups = 2, pties = 0, ints = 100, type = "char")
|
n |
Number of individuals in tournament |
matchups |
Number of times individuals compete in tournament. Can
be a numeric input, or, if |
pties |
Probability of each individual matchup ending in a tie. Default is 0, i.e. no ties. Needs to be a number between 0 and 1. |
ints |
The number of interactions in the tournament if matchups are set to random. |
type |
Whether to return results as W/L characters or 1/2 numbers.
|
A competition results dataframe
Specify number of individuals to compete in a tournament and
the number of times they compete with each other. Winners
and losers are determined at random. The resulting dataframe
will have variables: id1
, id2
, result
.
Result refers to the outcome from id1
's perspective, i.e. a "W"
refers to id1
beating id2
, and a "L" refers to
id2
beating id1
. Individuals are referred to by a
random assignment of two conjoined letters.
1 2 3 | randomtourney(20,2) #20 individuals interact twice with each other
randomtourney(5,6) #5 individuals interact six times with each other
randomtourney(8) #8 individuals interact twice with each other
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.