Description Usage Arguments Details
View source: R/response_sentiment.R
Creates data frame with one row per survey, selected question, and summarized sentiment. Three sentiment dictionaries are used; the first time this function runs you will need to download the dictionary (there will be a prompt in the console).
1 | response_sentiment(tidydata)
|
tidydata |
Data frame with the unnested phrases (usually from tidy_verbatim()) |
Afinn and Bing dictionaries will each produce a single score which represents the overall polarity of sentiment. These dictionaries score each applicable word for its negativity or positivity; Afinn scores from -5 to 5, while Bing just labels as negative/positive. The Afinn index is the sum of all individual word scores and the Bing index represents the count of positive words minus count of negative words.
The NRC dictionary assigns words to one of several sentiments, such as anger or joy. The summarized values will represent the count of words assigned to each sentiment on the response and question level.
The first time you run this function, if you have never used the sentiment lexicons in other work, you will be prompted to accept the license and download the lexicon to your pc.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.