This function creates an NRC emotion dataframe from a text corpus.

wordSentData(corp, word_len = c(3, 26))

Arguments

corp

tm package document Corpus object.

word_len

Numeric vector. Min and max length of words to include. Default is c(3, 26).

Value

An NRC sentiment dataframe.

Note

Uses the syuzhet package implementation of Saif Mohammad’s NRC emotion lexicon.