Description Usage Arguments Value Author(s) Examples
Input the document-term data_frame, match each word in each document to a sentiment database, and calculate the sentiment intensity of each document
1 | extract_sentiment(df, lexicon)
|
df |
The document-term data_frame output from create_DTM |
lexicon |
The sentiment database. lexicon = c("affin", "bing", "nrc", "loughran") |
A data_frame where each row represents a document and each column represents a sentiment. If we use "affin" then it returns the sentiment score
Jiacheng He
1 2 | extract_sentiment(text, "nrc")
extract_sentiment(text, "affin")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.