Merrill Birkner wrote:
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-


I think what you want is ?order.


a <- c(5, 1, 3, 4)
a.ord <- a[order(a)]

HTH,
Sundar

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to