Counting the NRC sentiments
The fourth dictionary included with the tidytext package is the nrc
dictionary. Let's start our exploration with sentiment counts.
This exercise is part of the course
Introduction to Text Analysis in R
Exercise instructions
- I usually do this for you, but start with loading the
tidyverse
andtidytext
packages. - Count the number of words associated with each sentiment in
nrc
. - Arrange the counts in descending order.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Load the tidyverse and tidytext packages
___(___)
___(___)
# Count the number of words associated with each sentiment in nrc
___(___) %>%
___(___) %>%
# Arrange the counts in descending order
___(___)