A few days ago, I collected 30 minutes of tweets all around the world. I used the twitteR and streamR packages for this. The nice thing about those tweets is that they have geo-information associated with them. Not all of them, of course, but more than enough.
Let’s see, what happens if we plot all the tweets at their respective position.
(this is a large PNG file, please click to enlarge)
Isn’t this awesome?! It’s a map of the world – without using any map packages or stuff like that. Only half an hour of tweets. Of course, some parts of the world are seriously underrepresented like Africa and Australia.
Where can we go from here? We have lots of information available. For example, we can use the time stamp to see the world map “emerge” over time. So, here’s a GIF also showing the running second from when I began to collect the tweets. Please note that I made larger steps at the end.
(5M gif, please click to enlarge)
There is another information associated with each tweet. It’s the language of the tweet according to Twitter’s classification algorithm. Let’s see how it looks if we assign a color to each of the TOP10 languages within these 30 minutes.
(click to enlarge)
And a high resolution version of the same plot (for zooming and stuff).
(high res version, click to enlarge)
Of course, we can have a look at different parts of the world.
Europe (click to enlarge).
(please refer to the legends in the other plots to know which color is which langauge).
Finally, the nice folks over at shinyapps.io
let you host your own Shiny application. Here, you can choose one or more of the TOP10 languages and the Shiny App creates your own map.
(CODE IS COMING SOON.)
To leave a comment
for the author, please follow the link and comment on their blog: Rcrastinate
offers daily e-mail updates
news and tutorials
on topics such as: Data science
, Big Data, R jobs
, visualization (ggplot2
), programming (RStudio
, Web Scraping
) statistics (regression
, time series
) and more...
If you got this far, why not subscribe for updates
from the site? Choose your flavor: e-mail
, or facebook