Skip to content

Instantly share code, notes, and snippets.

@toyeiei
Last active Aug 15, 2019
Embed
What would you like to do?
R4Excel - vlookup in R
## read a lookup table into R
lookup_state <- read.csv("lookup_table.csv")
## filter only US students
df_us <- filter(df, nationality == "US")
## we can use left_join to do vlookup in R
df_us %>%
left_join(lookup_state, by = c("id" = "us_students")) %>%
slice(1:10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment