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)
compute_scores(
d,
player0_score,
player1_score,
solve_ties = "random",
win_score = "higher"
)
dataframe
name of the column in data
name of the column in data
Method to solve the ties, either randomly allocate, or do nothing, or remove the row from the datasetc('random', 'none', 'remove').
decides if who wins is the one that has the highest score or the lowest score
a dataframe with column 'y' that contains the results of the comparison and a ties column indicating if there was ties