I am trying to left join table 1 'Person Name' to table 2 'Name' and get the values from the Work Group column in Table 2
df1 <- read.table(text="
Person_Name
PEREZ, MINDY
PEREZ, ABA
CLARKE, LINDA
THOMAS, NICOLE", header=T, sep="|")
df2 <- read.table(text=
'Name Work_Group
"Perez-Tie, Mindy" "Group A"
"Rulnick-Perez, Aba" "Group C"
"Mcabe-Clarke, Linda" "Group A"
"Thomas, Nicole" "Group B"', header=T)
This is my current code however it does not show any matches. I am not sure what i might be doing wrong but any help would be great!!
ci_str_detect <- function(x, y){str_detect(x, regex(y, ignore_case = TRUE))}
result <- fuzzy_left_join(Table1,Table2, by = c("Person_Name" = "Name"),
match_fun = ci_str_detect ) %>%
select(PersoN_Name,Name,Work_Group)
print(result)