my_lexicon <- data.frame(
word = c("love","love", "hate", "hate"),
sentiment = c("positive", "joy", "negative", "anger")
)
my_example_text <- "I am in love with R programming.
I hate writing code in C."
s_v <- get_sentences(my_example_text)
get_nrc_sentiment(s_v, lexicon=my_lexicon)
Run the code above in your browser using DataLab