extract_sentiment: Extract sentiment vectors from a document-term data_frame

Description Usage Arguments Value Author(s) Examples

Description

Input the document-term data_frame, match each word in each document to a sentiment database, and calculate the sentiment intensity of each document

Usage

1

Arguments

df

The document-term data_frame output from create_DTM

lexicon

The sentiment database. lexicon = c("affin", "bing", "nrc", "loughran")

Value

A data_frame where each row represents a document and each column represents a sentiment. If we use "affin" then it returns the sentiment score

Author(s)

Jiacheng He

Examples

1
2

JiachengHe/TextAnalysis documentation built on May 28, 2019, 7:51 a.m.