Learn R Programming

SentimentAnalysis (version 1.3-4)

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)

Value

Returns a new object of type SentimentDictionaryBinary

Arguments

positiveWords

is a vector containing the entries labeled as positive

negativeWords

is a vector containing the entries labeled as negative

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