If I have a dataframe with match results (3 possible values) and probabilities, for example:
FTR Probability
H 0.49
A 0.35
H 0.21
D 0.71
D 0.19
...
And I want for each possible value of Probability
to count the total no' of some FTR
value. lets say H
.
So I guess I should run a for loop that will run for every unique value of Probability
and count the number of H
in that group.
I tried doing that by writing:
for (i in 1:unique(dataframe$Probability)) { count(group_by(dataframe, FTR)) }
which doesn't work because I guess the problem starts with unique
cuz it can not run through actual values of probability
but their index value.