Why does my left.join fail? Indexing issue?
I need to apply an optimization function to millions of lines of data that returns a number based on two input variables. Applying the function using mapply takes forever. Since there are a limited range of values in the data with lots of repeats, I figured it would be faster to make a lookup table for the entire range of possible input combinations, and then just use a join from dplyr to fill in the data. My attempts have failed because of some strange behavior in my lookup table (actually a data frame). Below is a repeatable example. I’m trying to understand why I cannot reference some values in the lookup table, but others work OK.