Description Usage Arguments Value Examples
Takes an input of of single english words and outputs the number of words associated with eight emotions and positive/negative sentiment. This is based on the the crowd-sourced NRC Emotion Lexicon, which associates words with eight basic emotions (anger, fear, anticipation, trust, surprise, sadness, joy, and disgust) and two sentiments (negative and positive). For more information on NRC: http://saifmohammad.com/WebPages/NRC-Emotion-Lexicon.htm Note that words can be 0:n with emotions (either associated with none, 1, or many).
1 | sentiment_total(tweets, drop_sentiment = FALSE)
|
tweets |
1-column dataframe |
drop_sentiment |
A true/false bool that drops sentiment rows if no words are associated with that sentiment |
dataframe
1 2 3 4 5 6 | tweets <- data.frame(text_only = c("this is example tweet 1",
"this is example tweet 2 with a few extra words",
"is third",
"4th tweet",
"fifth tweet"))
sentiment_total(tweets, drop_sentiment = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.