So I have a large data set that I want to process in R. The equivalent excel function is below. I'm trying get the same result using the expss package match_row / index_row functions. Any help with this would be greatly appreciated. Basically I want the output value in df1 column D to be the value in column C in df2 where value A and value B in df1 match the value A and value B in the df2.
in excel I have this function:
=INDEX(df1!C:C, MATCH(1,INDEX((A2=df1!A:A)*(B2=df1!B:B),0,1),0))
see screenshot of my excel example below
which achieves what I want. however my dataset is to big for excel to handle and I want an executable script since the dataset will be updated periodically.
df1 (A) (B) (C)
# Organism Drug MIC
# A P 15
# A AM 11
# B P 9
# B AM 13
# C P 12
# C AM 10
df2 (A) (B) (C) (d)- calculated values
# Organism Drug Zone MIC
# C P 13 [MIC for row C, P in df1 = 12]
# A P 11 [MIC for row A, P in df1 = 15]
# C AM 10
# A AM 15
# B P 16
# C AM 12