Skip to main content
Premium project

A Text Analysis of Trump's Tweets

Apply text mining to Donald Trump's tweets to confirm if he writes the (angrier) Android half.

Start Project
12 Tasks1,500 XP

Loved by learners at thousands of companies


Project Description

This tweet containing a hypothesis about Donald Trump's Twitter account needs to be investigated with data:

<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Every non-hyperbolic tweet is from iPhone (his staff). <br><br>Every hyperbolic tweet is from Android (from him).</p>&mdash; Todd Vaziri (@tvaziri) <a href="https://twitter.com/tvaziri/status/762005541388378112?ref_src=twsrc%5Etfw">August 6, 2016</a></blockquote>

Others have explored Trump’s timeline and noticed this tends to hold up. And Trump himself did indeed tweet from a Samsung Galaxy until March 2017. But how could it be examined quantitatively? In this project, you will apply text mining and sentiment analysis to determine whether or not Trump does indeed write the angrier, Android tweets

The dataset used in this project is from The Trump Twitter Archive by Brendan Brown, which contains all 35,000+ tweets from the @realDonaldTrump Twitter account from 2009 (the year Trump sent his first tweet) through 2018.

Project Tasks

  1. 1
    The tweets
  2. 2
    Clean those tweets
  3. 3
    Is "time" the giveaway?
  4. 4
    The quote tweet is dead
  5. 5
    Links and pictures
  6. 6
    Comparison of words
  7. 7
    Most common words
  8. 8
    Common words: Android vs. iPhone (i)
  9. 9
    Common words: Android vs. iPhone (ii)
  10. 10
    Adding sentiments
  11. 11
    Android vs. iPhone sentiments
  12. 12
    Conclusion: The ghost in the political machine

Technologies

R R

Topics

Data ManipulationData VisualizationProbability & StatisticsImporting & Cleaning Data
David Robinson Headshot

David Robinson

Principal Data Scientist at Heap

Dave is the Principal Data Scientist at Heap. He has worked as a data scientist at DataCamp and Stack Overflow, and received his PhD in Quantitative and Computational Biology from Princeton University. Follow him at @drob on Twitter or on his blog, Variance Explained.
See More

What do other learners have to say?