View source: R/text_to_emotion.R
text_to_emotion | R Documentation |
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).
text_to_emotion(data, grouping = c("stars", "year"))
data |
Data frame created by |
grouping |
Should the data be grouped by Star Rating or Review Year |
The NRC lexicon should be a one time download.
List with three objects - "data" (star/year, sentiment, n count, percentage), "graph1" (dodged bar graph), "graph3 (stacked bar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.