How do I sort one vector based on values of another July 5, 2022 by Tarik what about this one x[order(match(x,y))]