Learn R Programming

quickPWCR (version 1.2)

randompair: randompair

Description

ramdonly pair players using reservoir sampling method.

Usage

randompair(players, k, cores = 1)

Value

dataframe

Arguments

players

vector, indicating a list of players.

k

numeric, indicating how many players each player will be paired with.

cores

numeric, indicating the number of CUP cores to be used for parallel

References

JVitter, J. S. (1985). Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1), 37-57.

Examples

Run this code
players <- c(1, 'a', 'c', 4, 7, 2, 'w', 'y', 3, 0, 8)
pw <- quickPWCR::randompair(players = players, k = 3)

Run the code above in your browser using DataLab