Site icon R-bloggers

Tired of doing real math 1 — some visualizations of Hillary Clinton and Donald Trump tweets

[This article was first published on Alexej's blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

As a grad student working primarily on statistical methodology, I regularly experience phases of total disillusionment with math/stats. Recently I realized that when I don’t feel like doing “real” math for prolonged periods of time, I instead can work on data analyses, which are mathematically unsophisticated (and possibly of low mathematical quality), but rather focus on simple techniques and/or visualizations of interesting data. Somebody at kaggle.com conveniently provides tweet data of this year’s two major presidential candidates. Here, I very briefly visually investigate this dataset.

< !--The goal, I guess, is to understand what messages the candidates convey with their tweets. But I won't go deep into interpretation of the results or political discussion. I first take a look at the top ten most popular tweets of either candidate, where tweet popularity is defined as the sum of the number of retweets and the number of favorites that a tweet has received. After some minimal data preprocessing, I plot a bar graph of retweet and favorite count for the top ten tweets, and overlay the tweet text on top of the bars in the graph. This results in the following visualizations.-->

(Larger image)

(Larger image)

Code

To leave a comment for the author, please follow the link and comment on their blog: Alexej's blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.