vlookup COMMAND


#1

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


#2

Hi @laura14

This blog post goes through a few methods

There is also the library vlookup which does it

Thanks


#3

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.


#4

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