Replace values in a vector based on another vector

Try with match

y[match(x, x.lvl)]

Leave a Comment