This is a seemingly simple R question, but I don\'t see an exact answer here. I have a data frame (alldata) that looks like this:
Case zip market 1
Here's the dplyr way of doing it:
dplyr
library(tidyverse) alldata %>% select(-market) %>% left_join(zipcodes, by="zip")
which, on my machine, is roughly the same performance as lookup.
lookup