R - replace values in dataframe based on two matching conditions
问题 I'm working with lists of spatial data for 20+ different sites (difficult to reproduce here; sorry in advance). I have three data frames associated with each site; each has a 'sample_ID' column and some other shared columns names. What I'm trying to do seems very simple: if the 'sample_ID' values match for two data frames and the column names match, replace the value in DF 1 with that of DF 2 and DF 3 three. Example: # DF 1: SAMPLE_ID CLASS_ID CLASS VALUE 1 0 0 5 2 0 0 5 3 0 0 3 4 0 0 6 5 0 0