Key Value Value2 Min Value Min Value2
1xA 1 2 1 2
2xA 2 3 2 3
3xB 3 1 2 2
1xB 1 1 1 1
1xA 5 5 1 2
2xB 2 6 2 6
3xB 2 2 2 2
2xA 4 1 2 3
In correspondence to the question I raised in this: Find minimum of a column with condition on another, for every observation in R
The Column Min. Value
is the minimum Value
corresponding to every Key
How can I also fill the Min Value2
which will be the Value2
corresponding to the Min. Value
obtained for every Key?