I have a data.frame including five columns as following:
name module m.red m.blue m.green
z red 0.22 0.1 0.09
g red 0.98 0.3 0.4
d green 0.08 0.2 0.87
k blue 0.2 0.88 0.4
b blue 0.1 0.9 0.3
I want to reduce this matrix to the following matrix based on the module name of each element:
name module m.module
z red 0.22
g red 0.98
d green 0.87
k blue 0.88
b blue 0.9
and then sort the elements of each module based on the m.module column in decreasing order. Can any one help me for doing it?
Thanks