Last active
August 15, 2019 07:44
-
-
Save toyeiei/3592948e2856be6c619e8cd889dd8879 to your computer and use it in GitHub Desktop.
R4Excel - vlookup in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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