I have two tibbles (dplyr 0.7.4 and R 3.4.1) I need to do the following
for every variable b in A, I need to check if b is equal to any of the variables c in tibble C and if yes, assign variable d, if not assign NA.
- First match is fine, if there are multiple matches, it is ok to use the first
- The two tibbles A and C have different number of rows
- I would like to use a method that allows to do a custom comparison with a generic function fun().
- I would prefer to do this in dplyr but any method will do.
Tibble A:
b
var1_b
var2_b
...
Tibble C
c,d
var1_c, var1_d
var2_c, var2_d
...