Created
August 15, 2019 07:44
-
-
Save toyeiei/074fe3e11695ad4864591cbac607c8f3 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") | |
## we can use left_join to do vlookup in R | |
df_us <- filter(df, nationality == "US") | |
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