Learn R Programming

SentimentAnalysis (version 1.1-0)

SentimentDictionaryBinary: Create a sentiment dictionary of positive and negative words

Description

This routines creates a new object of type SentimentDictionaryBinary that stores two separate vectors of negative and positive words

Usage

SentimentDictionaryBinary(positiveWords, negativeWords)

Arguments

positiveWords
is a vector containing the entries labeled as positive
negativeWords
is a vector containing the entries labeled as negative

Value

Returns a new object of type SentimentDictionaryBinary

See Also

SentimentDictionary

Examples

Run this code
# generate a dictionary with positive and negative words
d <- SentimentDictionaryBinary(c("increase", "rise", "more"),
                               c("fall", "drop"))
summary(d)
# alternative call
d <- SentimentDictionary(c("increase", "rise", "more"),
                         c("fall", "drop"))
summary(d)

Run the code above in your browser using DataLab