Using base R only, I'm trying to iterate and test if table1$"DATE" is >= table2$"START"& <= table2$"STOP" where table1$"EVENT" == table2$"EVENT". I initially thought to get unique categories from table1$"EVENT" and then subset via looping then outer-joining to table2 and after that using for-loop to iterate each table1 row against table2 rows to return the value but for loops are slow and my real data set has over 3 million rows and is grows daily. In Python I'd probably try something with pd.intervalrange or some similar approach.
This is the table of events I want to return a value to based on if DATE is between table2's START and STOP columns where EVENT matches in both table1 and table2.
table1
table2 (lookup table)
desired outcome