I have the two following tables:
df <- data.frame(eth = c(\"A\",\"B\",\"B\",\"A\",\"C\"),ZIP1 = c(1,1,2,3,5)) Inc <- data.frame(ZIP2 = c(1,2,3,4,5,6,7)
my solution(which maybe seems awkward)
for (i in 1:length(df$eth)) { df$Inc[i] <- Inc[as.character(df$eth[i])][df$ZIP[i],] }