Get startedGet started for free

Counting sentiment

The tidy_twitter dataset has been loaded for you. Let's see what sort of sentiments are most prevalent in our Twitter data.

This exercise is part of the course

Introduction to Text Analysis in R

View Course

Exercise instructions

  • Join tidy_twitter and the NRC sentiment dictionary.
  • Count the sentiments in sentiment_twitter.
  • Arrange the sentiment counts in descending order.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Join tidy_twitter and the NRC sentiment dictionary
sentiment_twitter <- ___ %>% 
  ___(___("nrc"))

# Count the sentiments in sentiment_twitter
___ %>% 
  ___(___) %>% 
  # Arrange the sentiment counts in descending order
  ___(___)
Edit and Run Code