numEntries: Number of words in dictionary

numEntriesR Documentation

Number of words in dictionary

Description

Counts total number of entries in dictionary.

Usage

numEntries(d)

Arguments

d

Dictionary of type SentimentDictionaryWordlist, SentimentDictionaryBinary or SentimentDictionaryWeighted

See Also

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

Examples

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

SentimentAnalysis documentation built on Aug. 24, 2023, 1:07 a.m.