R - Create a new variable where each observation depends on another table and other variables in the table
R - Create a new variable where each observation depends on another table and other variables in the data frame