table_A: employee_id, internal_id, ...
table_B: unknown_id, department
Как лучше написать функцию, сопоставляющую unknown_id в table_B с каждым из столбцов id в table_A последовательно?
псевдокод / идея:
step1 <- table_A %>%
left_join (table_B, by=(employee_id = unknown_id)
step2 <- step1 %>%
filter(is.na(department)) ***# get all the non-matching rows***
step3 <- step2 %>%
left_join (table_B, by= (internal_id = unknown_id))
step4 <- step3 %>%
filter(is.na(department) ***# get all the non-matching rows again, then try other id columns if it is available***