I have a data frame like this:
Var1 Var2 value
x5 x1 2
x6 x1 6
x1 x2 2
x5 x2 2
x6 x2 4
x7 x2 3
And I'd like to reshape/aggregate/summarise it according to corresponding Var2
with minimum values of each pairs of Var1
, just like that:
Var3 Var4 minvalue
x5 x6 2
x1 x5 2
x1 x6 2
x1 x7 2
x5 x6 2
x5 x7 2
x6 x7 3
If you combine Var1
values by corresponding Var2
values select minimum value. E.g x1
as Var2
is connects x5
and x6
as Var1
and value is min(x5,x6)=2
Any idea?