For the function: get_wl_df
At line 34 and 35 – it makes two new data frames: one for id1 winners (a1) and one for id2 winners (a2) so winners are always in the 1st column and losers in the 2nd column.
At line 36 – it adds a new column to both of these new data frames called “result” to give all id1 values 1 — winners.
However, if there are no id2 winners then the code for assigning a new column to the id2 data frame (a2) does not work.
For the function: get_wl_df
At line 34 and 35 – it makes two new data frames: one for id1 winners (a1) and one for id2 winners (a2) so winners are always in the 1st column and losers in the 2nd column.
At line 36 – it adds a new column to both of these new data frames called “result” to give all id1 values 1 — winners.
However, if there are no id2 winners then the code for assigning a new column to the id2 data frame (a2) does not work.