Innovation Learning NLP R

Welcoming Students with Social Wordclouds

Learn to get tweets to make a colourful wordcloud

Ah, the wordcloud. People can’t get enough of those proportionately-sized words, right?

As a Data Scientist, I don’t expect wordclouds to be a deciding factor in closing firm’s largest account ever; it’s certainly more of a fun thing.

However, as someone from a Social Media Marketing background, I do like having fun things to share. If it has pretty colours, even better. Let’s review a social media checklist I made right now:

  • Colourful [ √ ]
  • Related [ √ ]
  • Simple [ √ ]

A wordcloud does fill this niche and it turns out making one isn’t too hard!

So today, we are going to look at my past University and their hashtag #RoadToRyerson that welcomes students to campus and make a ~ spirited wordcloud ~ that can entice students to join the conversation.

Use Colormind to Easily Build a Palette

If you love painting your face and hollering chants down the hallways,  you’re going to love neural networks! Why? Because this one can adjust all those colours on your face so they fit in a sensible palette sequence.

This is what Colormind does. It uses a neural network to pick out then adjust colours from uploaded images so they compliment each other in a full colour palette. It’s great for translating colour themes for visualizations.

Here’s a schedule for Ryerson’s frosh week I uploaded to get some colours from:


Colormind adapts colours to better suit a gradient template in the spirit of the original source.


I definitely like these new colours Ryerson chose, but I also want Ryerson’s official Blue instead of the faint one being picked up from the squiggly line header.

I simply uploaded the official logo to Colormind…


…and took the code #1C5F9B for the Blue to replace it.

I also dropped that light colour from the palette leaving me with four colours; the words were simply too hard to see on a white background.

Here’s what we’re left with:



We Must Ask Twitter for Tweets

Here’s necessary R packages to aid in our mission to give these students some content:


To get this machine up and running, you’ll need to make an app at with a Callback URL of – the website can be anything relevant like your GitHub page.

After making the app, use the consumer information from the Keys and Access Tokens tab to create a token for interacting with the Twitter API. The code looks like this and will pop up your browser confirming your success – just substitute your app’s information below:

create_token(app = "your_app_name_here",
  consumer_key = "WavWWzicOXUjqmglUpeCO32ge",
  consumer_secret = "dGHwfTkudLTm5VK5ZBh9BnIuhX2Mzg32quO57ovRcglxiUgKeW")

Yes, I said this was simple and that was kind of hard. You might even have StackOverFlow open in the next tab, but you can use this token to scrape Twitter anytime you want, so it’s well worth the effort to get this thing running correctly.

Getting #RoadToRyerson Tweets

We will pull 2000 unique #RoadToRyerson tweets — just over a week’s worth.

# get recent tweets
rtr <- search_tweets("#RoadToRyerson", n = 2000, include_rts = FALSE)

# tokenizing and cleaning
rtrTable <- rtr %>%
    unnest_tokens(word, text) %>%  # unnest the words
    anti_join(stop_words) %>%  # remove stop words
    count(word, sort = T) %>% # do a word count
    filter(!word %in% c('', 'https', 'roadtoryerson', 'amp', 'ryersonu', 'ryerson', 'ryersonsa', 'ryersonfcs', 'student', 1:10))

# quick look


Great, we have our data prepared. Our main topics were students, orientation, and campus. 

Let’s add our palette colours to the wordcloud2 function and give it a parameter to repeat our school colours until the table ends.

# wordcloud using the ryerson colour palette
ryePallete <- c('#1C5F9B', '#C1138A', '#2E1D3B', '#FCC210')
wordcloud2(rtrTable, size=0.7, color=rep_len(ryePallete, nrow(rtrTable)))
I see party and fun are more frequent than learn

Yes, a wordcloud is a fun way to show the conversation around a hashtag, especially during a conference or orientation week – adding the right colours can truly personalize it.

Colormind helped give us that branded feel; it deserves a lot of credit for making the simple, colourful, and relevant palette for our wordcloud.

Thanks For Reading — Now Try This:

Build a branded wordcloud for your own school’s orientation week!
(I bet their social media manager would love to retweet it)

Share your project in the comments or tweet us @DataCritics
(I also would love to retweet it)

Full GitHub Project Here

0 comments on “Welcoming Students with Social Wordclouds

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: