Hi listers, I would like to merge two vectors as follows... A<-c(3,5,7,18,43,85,91,98,100,130,230,487) #data values B<-c(10,5,5,10,8,11,2,7,3,11,10) #random numbers (sample) I would like to set the vector of random numbers according to the order set of the vector of data values... The result would be: (130,43,43,130,98,230,5,91,7,230,130) I could do this with merging, but I would need to set a primary key to merge the vectors... Is there a way of doing directly... Thanks in advance, Marcio
-- View this message in context: http://www.nabble.com/Merge-vectors-tp24612997p24612997.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.