I have following data frame :
Claim failure Part csp_rate sml_rate
23 F1 P1 45 65
45 F2 P4 80 56
55 F3 P4 45 82
65 F1 P4 75 77
and another data frame (which has data in columns exactly same as column names of first data frame)
Threshold weight similarity
70 1 csp_rate
75 2 sml_rate
I want my final data frame to be like following
Claim failure Part csp_rate sml_rate weight
23 F1 P1 45 65 0
45 F2 P4 80 56 1
55 F3 P4 45 82 2
65 F1 P4 75 77 3
Here weight is sum of weight having similarity (from data frame 1) >= threshold (from data frame 2) e.g. 1,2,3 etc
Can you guys help? stucked at it since long time now.
proposed duplicate question is about joining two dataframes using dplyr::left_join(). The condition to join is less-than, greater-than i.e, <= and > which in my (above) case isn't same.