I am trying to create a heatmap in order to visualize matches and mismatches between some predicted and expected values.
If a is the data frame containing the predicted values and b the expected ones;
a = rbind (sample(0:1, size=14, replace = T),sample(0:1, size=14, replace = T))
b = rbind (sample(0:1, size=40, replace = T),sample(0:1, size=40, replace = T))
How can I create a third data frame containing only the common columns of a & b and give back
- a certain value when a value is the same in the two data frames
- another value if the predicted value was 0 and the expected 1
- another value if the predicted value was 1 and the expected 0.