vlookup COMMAND


hey, i'm looking for a commend like in excel calld "vlookup" to use in R. tnx


Hi @laura14

This blog post goes through a few methods

There is also the library vlookup which does it



You should be aware that vlookup and merge do not function the same way. Vlookup will only return the first instance of a match while merge will return all possible matches. This is typically observed as an increase in overall rows of your data set.

Iā€™d recommend you try to learn some basic SQL function to better understand this. It will help you understand the limits of vlookup.


library(dplyr) has inner, right, and left join which, may be more to your liking. Very handy package to have installed, well for me anyway. :slight_smile:

Quick look at joining using dplyr