small rewrite avoiding that the weights and classifier have to be tuned with the IDs,
df_names <- data.frame(Name=c("Peter","Peter","Peter","Connor","Matt"))
df_names %>% compare.dedup() %>%
epiWeights() %>%
epiClassify(0.3) %>%
getPairs(show = "links", single.rows = TRUE) -> matches
left_join(mutate(df_names,ID = 1:nrow(df_names)),
select(matches,id1,id2) %>% arrange(id1) %>% filter(!duplicated(id2)),
by=c("ID"="id2")) %>%
mutate(ID = ifelse(is.na(id1), ID, id1) ) %>%
select(-id1)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…