randompair {quickPWCR}R Documentation

randompair

Description

ramdonly pair players using reservoir sampling method.

Usage

randompair(players, k, cores = 1)

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

Value

dataframe

References

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

Examples

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


[Package quickPWCR version 1.0 Index]