compute_scores {bpcs}R Documentation

Giving a player0 an player1 scores, this functions adds one column to the data frame containing who won (0= player0 1=player1 2=tie) and another if it was a tie. The ties column superseeds the y column. If it was tie the y column does not matter y column: (0= player0 1=player1 2=tie) ties column (0=not tie, 1=tie)

Description

Giving a player0 an player1 scores, this functions adds one column to the data frame containing who won (0= player0 1=player1 2=tie) and another if it was a tie. The ties column superseeds the y column. If it was tie the y column does not matter y column: (0= player0 1=player1 2=tie) ties column (0=not tie, 1=tie)

Usage

compute_scores(
  d,
  player0_score,
  player1_score,
  solve_ties = "random",
  win_score = "higher"
)

Arguments

d

dataframe

player0_score

name of the column in data

player1_score

name of the column in data

solve_ties

Method to solve the ties, either randomly allocate, or do nothing, or remove the row from the datasetc('random', 'none', 'remove').

win_score

decides if who wins is the one that has the highest score or the lowest score

Value

a dataframe with column 'y' that contains the results of the comparison and a ties column indicating if there was ties


[Package bpcs version 1.0.0 Index]