Learn R Programming

SentimentAnalysis (version 1.1-0)

numPositiveEntries: Number of positive words in dictionary

Description

Counts total number of positive entries in dictionary.

Usage

numPositiveEntries(d)

Arguments

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