emoxicon: Emoxicon

Description Usage Arguments Author(s) References See Also Examples

View source: R/emoxicon.R

Description

Calculates emotion scores in texts using a bag-of-words approach. The default lexicon was compiled by Araque, Gatti, Staiano, and Guerini (2018).

Usage

1
emoxicon(text, lexicon = emotions, exclude)

Arguments

text

A dataframe containing texts to be scored (one text per row).

lexicon

The lexicon used to score the words. The default is the emotions dataset, a modification of the lexicon developed by Araque, Gatti, Staiano, and Guerini (2018). To use the raw lexicon from Araque et. al (2018) containing the original probability weights, use the weights dataset. If another custom lexicon is used, the first column of the lexicon should contain the terms and the subsequent columns contain the scoring categories.

exclude

A vector listing terms that should be excluded from the lexicon. Words specified in exclude will not influence document scoring. Users should consider excluding 'red herring' words that are more closely related to the topics of the documents, rather than the documents' emotional content. For example, the words "clinton" and "trump" are present in the lexicon and are both associated with the emotion 'AMUSED'. Excluding these words when analyzing political opinions may produce more accurate results.

Author(s)

Tara Valladares <tls8vx at virginia.edu>, Hudson F. Golino <hfg9s at virginia.edu>

References

Araque, O., Gatti, L., Staiano, J., and Guerini, M. (2018). DepecheMood++: a Bilingual Emotion Lexicon Built Through Simple Yet Powerful Techniques. ArXiv preprint is available at https://arxiv.org/abs/1810.03660.

See Also

emotions, where we describe how we modified the original DepecheMood++ lexicon.

Examples

1
2
3
4
5
6
7
8
# Load the tinytrolls data
data(tinyTrolls)

# Use the emoxicon function
## Not run: 
emotions.tinytrolls <- emoxicon(text = tinyTrolls$content, lexicon = emotions)

## End(Not run)

tvall/emoxicon documentation built on Dec. 31, 2020, 9:39 a.m.