SentimentAnalysis1.3-5 package

Dictionary-Based Sentiment Analysis

analyzeSentiment

Sentiment analysis

compareDictionaries

Compares two dictionaries

compareToResponse

Compare sentiment values to existing response variable

convertToBinaryResponse

Convert continuous sentiment to direction

convertToDirection

Convert continuous sentiment to direction

countWords

Count words

enetEstimation

Elastic net estimation

extractWords

Extract words from dictionary

generateDictionary

Generates dictionary of decisive terms

glmEstimation

Estimation via generalized least squares

lassoEstimation

Lasso estimation

lmEstimation

Ordinary least squares estimation

loadDictionaryGI

Loads Harvard-IV dictionary into object

loadDictionaryHE

Loads Henry's finance-specific dictionary into object

loadDictionaryLM

Loads Loughran-McDonald dictionary into object

loadDictionaryLM_Uncertainty

Loads uncertainty words from Loughran-McDonald into object

loadDictionaryQDAP

Loads polarity words from qdap package into object

loadImdb

Retrieves IMDb dataset

lookupEstimationMethod

Estimation method

ngram_tokenize

N-gram tokenizer

numEntries

Number of words in dictionary

numNegativeEntries

Number of negative words in dictionary

numPositiveEntries

Number of positive words in dictionary

plot.SentimentDictionaryWeighted

KDE plot of estimated coefficients

plotSentiment

Line plot with sentiment scores

plotSentimentResponse

Scatterplot with trend line between sentiment and response

predict.SentimentDictionaryWeighted

Prediction for given dictionary

preprocessCorpus

Default preprocessing of corpus

print

Output content of sentiment dictionary

read

Read dictionary from text file

ridgeEstimation

Ridge estimation

ruleLinearModel

Sentiment based on linear model

ruleNegativity

Ratio of negative words

rulePositivity

Ratio of positive words

ruleRatio

Ratio of dictionary words

ruleSentiment

Sentiment score

ruleSentimentPolarity

Sentiment polarity score

ruleWordCount

Counts word frequencies

SentimentAnalysis-package

SentimentAnalysis: A package for analyzing sentiment of texts

SentimentDictionary

Create new sentiment dictionary based on input

SentimentDictionaryBinary

Create a sentiment dictionary of positive and negative words

SentimentDictionaryWeighted

Create a sentiment dictionary of words linked to a score

SentimentDictionaryWordlist

Create a sentiment dictionary consisting of a simple wordlist

spikeslabEstimation

Spike-and-slab estimation

summary

Output summary information on sentiment dictionary

toDocumentTermMatrix

Default preprocessing of corpus and conversion to document-term matrix

transformIntoCorpus

Transforms the input into a Corpus object

write

Write dictionary to text file

Performs a sentiment analysis of textual contents in R. This implementation utilizes various existing dictionaries, such as Harvard IV, or finance-specific dictionaries. Furthermore, it can also create customized dictionaries. The latter uses LASSO regularization as a statistical approach to select relevant terms based on an exogenous response variable.

  • Maintainer: Nicolas Proellochs
  • License: MIT + file LICENSE
  • Last published: 2023-08-23