I am trying to count a binary character outcome by row in a large data frame:
V1 V2 V3 V4 V5
Loss Loss Loss Loss Loss
Loss Loss Win Win Loss
Loss Loss Loss Loss Loss
What I need to know is the frequency of wins and losses by row. This is just a short example (fragment of large simulated output) but for row 1, in five simulations, I have five Losses, row two three loss and two win, etc.
I was hoping to generate either a separate table that shows the frequency of wins/loss by row or, if that won't work, add two new columns: one that provides the number of "Win" and "Loss" for each row.
Each row is a different case, and each column is a replicate of that case. This appears as a data frame of factors with two levels "Loss" "Win".