head-to-head-helpers: Helpers for computing Head-to-Head matrices

Description Usage Arguments Value See Also Examples

Description

Helpers for computing Head-to-Head matrices.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
players_drop(h2h_mat, ...)

fill_h2h(h2h_mat, fill = NA_real_, ...)

## S3 method for class 'h2h'
print(x, ...)

get_cr_players(cr_data, players = NULL, ...)

get_cr_matchups(cr_data)

Arguments

h2h_mat

Head-to-Head matrix.

...

Additional arguments to be passed to or from methods.

fill

Value to fill with.

x

Value to print.

cr_data

Competition results.

players

Vector of players for which Head-to-Head is computed.

Value

players_drop removes from h2h_mat rows and columns of the players for which either row or column contain only NA (in most cases it means these players are absent in original competition results).

fill_h2h replaces NAs in h2h_mat with fill.

get_cr_players in case of argument players is NULL returns vector of players present in cr_data. If not NULL then returns its argument players.

get_cr_matchups returns a tibble of all matchups (pairs of players from one game) present in cr_data. It has following columns:

game

Game identifier of matchup

player1

Identifier of first player in matchup

score1

Score of the first player in matchup

player2

Identifier of second player in matchup

score2

Score of the second player in matchup

Note that matchups are not symmetrical: matchup "player1"-"player2" is considered different from "player2"-"player1" in order to except more advanced, not symmetrical Head-to-Head values.

See Also

head-to-head Abstract computing of Head-to-Head matrices.

head-to-head-functions Specific functions for computing Head-to-Head matrices.

Examples

1
2
3
4
5
6
7
cr_data <- data.frame(
  game = rep(1:5, each = 3),
  player = rep(1:5, times = 3),
  score = 31:45
)
get_cr_players(cr_data, players = NULL)
get_cr_matchups(cr_data)

echasnovski/comperes documentation built on June 21, 2017, 1:17 a.m.