[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.
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.-->Code
- I have uploaded a script producing very similar word clouds as the above ones to kaggle.com. Arguably a word cloud is far from being a good statistical tool, but it’s fun. Besides, it gave me an opportunity to improve my regex skills, and to learn about palettes and s in R (http://colorbrewer2.org is awesome!).
- I have also written a script producing the above visualizations of the top ten tweets of either presidential candidate, learning more about ggplot2 in the process.
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.