我有一个向量x,我想根据向量y中的值的顺序排序.两个向量的长度不同.
x <- c(2, 2, 3, 4, 1, 4, 4, 3, 3) y <- c(4, 2, 1, 3)
预期结果将是:
[1] 4 4 4 2 2 1 3 3 3
sorting r
r ×1
sorting ×1