Learn R Programming

SentimentAnalysis (version 1.1-0)

numEntries: Number of words in dictionary

Description

Counts total number of entries in dictionary.

Usage

numEntries(d)

Arguments

See Also

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

Examples

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

Run the code above in your browser using DataLab