[R] re order vector in order given by another vector

jimineep jamesrperkins at hotmail.com
Thu Aug 7 13:20:25 CEST 2008


So imagine I have a vector:

zz = c("a","c","d","b")

and another vector:

xx = c("d","c","a","b")

I need to get xx in the same order as zz. I am sure this is very simple but
I can't figure it out from the help pages for order or sort. Perhaps I'm not
trying hard enough but its been bugging me for a while.... Can anyone help?
-- 
View this message in context: http://www.nabble.com/re-order-vector-in-order-given-by-another-vector-tp18868253p18868253.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list