[R] rearranging rows

Luca De Benedictis debene at unimc.it
Wed Feb 5 01:21:03 CET 2003


Dear all,
I am working with a matrix structured as follows

                    Factor 1    Factor2  ...
Country 1
Country 1
Country 2
Country 2
...

Country N
Country N

and I need to rearrange it according to the following scheme


                    Factor 1    Factor2  ...
Country 2
Country 2
Country N
Country N
...

Country 1
Country 1

where countries are ordered accordingly to the average value of factor 1

correspondent to each country.
What is the easy way of doing it?

Many thanks in advance,

Luca




More information about the R-help mailing list