[R] reordering numbers in a vector

Merrill Birkner merbirk at yahoo.com
Tue Nov 18 00:21:18 CET 2003

Suppose you initially create a vector a<-c(5,1,3,4). 
You want to sort the vector before performing specific
calculations to the numbers.  You now have the vector
[1,3,4,5].  How can you now revert back to your
initial ordering of [5,1,3,4]? Is there a specific
command or 'sort by' command that one could use?

Thanks again-

More information about the R-help mailing list