Skip to content

MeindertHH/Financial-sentiment-analysis-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Description

Perform a quick and simple financial sentiment analysis in R using the dictionary of Loughran & McDonald. It counts the number of financially positive and negative words in multiple texts at once.

Basic Usage

Install and load package 'tm'

> install.packages("tm")
> library(tm)

Load a collection of documents

> docs <- Corpus(DirSource("foldername")) # replace foldername

Load the dictionaries as a character vector

Dictionaries are provided by McDonald at http://www3.nd.edu/~mcdonald/Word_Lists.html. The positive and negative word lists should be a character vector in R. For example:

> dictneg <- readLines("negative.csv")
> dictpos <- readLines("positive.csv")

License

See LICENSE.md for a full copy of the MIT-license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages