Learn R Programming

SentimentAnalysis (version 1.3-4)

numPositiveEntries: Number of positive words in dictionary

Description

Counts total number of positive entries in dictionary.

Usage

numPositiveEntries(d)

Arguments

d

is a dictionary of type SentimentDictionaryBinary or SentimentDictionaryWeighted

See Also

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

Examples

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

Run the code above in your browser using DataLab