That is in the messy column, so that both columns contain the same string—firstname[space] lastname? If so
suppressPackageStartupMessages({
library(dplyr)
library(stringr)
})
the_names <- data.frame(df1 = c("Oliver Wendell Holmes","Richard Feynman"),
df2 = c("Justice Oliver Holmes", "Richard Feynman, Nobel Prize Winner"))
the_names <- the_names %>% mutate(matched = ifelse(str_detect(df2,df1),TRUE,FALSE))
the_names
#> df1 df2 matched
#> 1 Oliver Wendell Holmes Justice Oliver Holmes FALSE
#> 2 Richard Feynman Richard Feynman, Nobel Prize Winner TRUE