text_to_emotion: Text to Emotion

View source: R/text_to_emotion.R

text_to_emotionR Documentation

Text to Emotion

Description

Applying the NRC lexicon to the review texts. Each term from the reviews is matched to the lexicon. For each star rating, all emotional terms are then counted and percentages calculated for each grouping (rating).

Usage

text_to_emotion(data, grouping = c("stars", "year"))

Arguments

data

Data frame created by GSPtext::get_reviews() or in the same format

grouping

Should the data be grouped by Star Rating or Review Year

Details

The NRC lexicon should be a one time download.

Value

List with three objects - "data" (star/year, sentiment, n count, percentage), "graph1" (dodged bar graph), "graph3 (stacked bar)


taylorgrant/GSPtext documentation built on April 15, 2023, 10:56 p.m.