Try with match
y[match(x, x.lvl)]
More Related Contents:
- Replace values greater than zero with 1 in r
- How to replace NA values in a table for selected columns
- Replace NA in column with value in adjacent column
- Replace specific characters within strings
- Replace all particular values in a data frame
- Match values in data frame with values in another data frame and replace former with a corresponding pattern from the other data frame
- Remove all text before colon
- How to replace NaN value with zero in a huge data frame?
- Replace given value in vector
- in R, use gsub to remove all punctuation except period
- R: Replace multiple values in multiple columns of dataframes with NA
- Replacing occurrences of a number in multiple columns of data frame with another value in R
- Using get() with replacement functions
- Replace a value NA with the value from another column in R
- Replace all values in a matrix
- Replace in a factor column
- Replace empty values with value from other column in a dataframe
- replacing values in a column with another column R
- Why does X[Y] join of data.tables not allow a full outer join, or a left join?
- Subset data frame based on multiple conditions [duplicate]
- UTF-8 file output in R
- Using Rcpp within parallel code via snow to make a cluster
- Extract every nth element of a vector
- Is there a R function that applies a function to each pair of columns?
- Getting the last n elements of a vector. Is there a better way than using the length() function?
- Rscript: There is no package called …?
- Dataframe create new column based on other columns
- Find K nearest neighbors, starting from a distance matrix
- How to collapse many records into one while removing NA values
- Multiply columns in a data frame by a vector