library(tidyverse)
my_df %>%
left_join(., dictionary, by = "word") %>%
mutate(sentiment = coalesce(sentiment.x, sentiment.y)) %>%
select(-ends_with(c(".x", ".y")))
gives:
name word sentiment
1 Alice absence negative
2 Alex accomplish positive
3 Andrew angry negative
4 Amy envy <NA>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…