My data looks like this:
df <- tribble(
~A, ~B,
0.2, 0.1,
0.2, 0.3,
0.5, 0.1,
0.7, 0.9,
0.8, 0.9,
0.4, 0.2)
How might I select the max/min value between A
and B
?
Desired Output:
A B C
1 0.2 0.1 0.2
2 0.2 0.3 0.3
3 0.5 0.1 0.5
4 0.7 0.9 0.9
5 0.8 0.9 0.9
6 0.4 0.2 0.4