I want to get the minimum of two columns and create a column in the same data.frame. How can I do that?
For example:
ID Parm1 Parm2
1 1 2
2 0 1
3 2 1
4 1 0
5 2 0
Desired output :
ID Parm1 Parm2 Min
1 1 2 1
2 0 1 0
3 2 1 1
4 1 0 0
5 2 0 0
data$Min <- with(data, pmin(Parm1, Parm2))
– Manslayer