You seem to have multiple post. here is something I put together based on my understanding of your problem.
dat<- data.frame(word1=c( "will", "like","get", "look", "next", "social",
"cinco_de","manufacturer_custom", "custom_built"),
word2=c(" ", " ", " ", "like","week", "media", "mayo", "built", "painted"),
frequency = c( 5153, 5081, 4821, 559, 478,465, 172,171,171 ) )
word_exist <- function(word, df){
ifelse(word %in% df$word1, "match found", "match not found")
}
word_exist("dog_social", dat)