Learn R Programming

compete (version 0.1)

get_wl_df: Converts results dataframe to win-loss dataframe

Description

Converts results dataframe to win-loss dataframe

Usage

get_wl_df(df, ties = "remove")

Arguments

df
A results dataframe
ties
How to handle ties, default is ties="remove" Alternative is ties="keep"

Value

A win-loss dataframe

Further details

A results dataframe first 3 variables are id1, id2, result. Results can be "W", "L", or "T" or "1", "0", "0.5". The output will be a win-loss dataframe that will reorganize the first 3 variables into winner, loser and result (=1 for Win or =0.5 for ties).

Examples

Run this code
get_wl_df(randomtourney(8))

Run the code above in your browser using DataLab