How to Show Sentiment in Word Clouds using R

Displayr
1 min readFeb 15, 2018

--

The Word Cloud above summarizes some data from tweets by President Trump. The green words are words that are significantly more likely to be used in tweets with a positive sentiment. The red represents words more likely to be used in negative tweets.

The code I used to create this tweet is below. All you need to do to run is to make sure you have installed the relevant packages (from github), and replace input.phrases in the first line with your data. Please read How to Show Sentiment in Word Clouds for a more general discussion of the logic behind the code below.

Create Your Own Word Cloud in Displayr!

The R code

Originally published at Displayr.

--

--

Displayr

Displayr is a data science, visualization, and reporting platform for everyone.