I have two vectors:
A <- c(1,3,5,6,4,3,2,3,3,3,3,3,4,6,7,7,5,4,4,3)
B <- c("a","b","c","d","e","f","g")
I would like to combine the values of B with A so that the smallest value in gets the first value from B and continues to the largest.
The above example:
A: 1 3 5 6 4 3 2 3 3 3 3 3 4 6 7 7 5 4 4 3
assigned: a c e f d c b c c c c c d f g g e d d c
source
share