Learn R Programming

edgar (version 1.0.9)

getSentimentCount: Parse sentiment words from EDGAR filing.

Description

getSentimentCount get sentiment words count from filing.

Usage

getSentimentCount(word.frq, words.list)

Arguments

word.frq

Word frequency dataframe created using getWordfrquency function.

words.list

Word list as a sentiment dictionary.

Value

Function returns sentiment words frequency dataframe.

Details

getSentimentCount function takes words frequency dataframe as an input from getWordfrquency function. It compares these words with the input dictionary and parse matched words with their frequencies.

Examples

Run this code
# NOT RUN {
words.list <- scan(system.file('data/negwords.txt', package = 'edgar'), what='character')
## User can apply any desired user defined dictionary other than 
## default dictionaries from this package in txt format with each word in separate line.

senti.words <- getSentimentCount(word.frq, words.list)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab