Learn R Programming

SentimentAnalysis (version 1.3-5)

numNegativeEntries: Number of negative words in dictionary

Description

Counts total number of negative entries in dictionary.

Usage

numNegativeEntries(d)

Arguments

d

is a dictionary of type SentimentDictionaryBinary or SentimentDictionaryWeighted

See Also

numEntries and numPositiveEntries for more option to count the number of entries

Examples

Run this code
numNegativeEntries(SentimentDictionary(c("increase", "rise", "more"),
                            c("fall", "drop"))) # returns 2
numNegativeEntries(SentimentDictionary(c("increase", "decrease", "exit"),
                               c(+1, -1, -10),
                               rep(NA, 3))) # returns 2

Run the code above in your browser using DataLab