<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/putting-data-on-maps-using-r-easier-than-ever/"></div></div><div><a data-url="https://www.r-bloggers.com/putting-data-on-maps-using-r-easier-than-ever/" data-counturl="https://www.r-bloggers.com/putting-data-on-maps-using-r-easier-than-ever/" data-count="horizontal" data-text="Putting data on maps using R: easier than ever" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://nsaunders.wordpress.com/2016/11/24/putting-data-on-maps-using-r-easier-than-ever/"> R – What You're Doing Is Rather Desperate</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>
<div data-shortcode="caption" class="wp-caption"><a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/2016/11/24/putting-data-on-maps-using-r-easier-than-ever/map1-1/"><img sizes="(max-width: 300px) 100vw, 300px" alt="New Zealand earthquake density 2010 - November 2016" class="wp-image-4395" src="https://i2.wp.com/nsaunders.files.wordpress.com/2016/11/map1-1.png?resize=300%2C214&ssl=1" data-recalc-dims="1"></a>
<p class="wp-caption-text">New Zealand earthquake density 2010 – November 2016</p>
</div>
<p>Using R to add data to maps has been pretty straightforward <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/2010/10/09/biostar-users-of-the-world-unite/">for a few years now</a>. That said, it seems easier than ever to do things like use map APIs (<em>e.g.</em> Google, Open Street Map), overlay quite complex data visualisations (<em>e.g.</em> “heatmap-style” densities) and even generate animations.</p>
<p>A couple of key R packages in this space: <a target="_blank" rel="nofollow" href="https://github.com/dkahle/ggmap">ggmap</a> and <a target="_blank" rel="nofollow" href="https://github.com/dgrtwo/gganimate">gganimate</a>. To illustrate, I’ve used data from the recent New Zealand earthquake to generate some static maps and an animation. Here’s the <a target="_blank" rel="nofollow" href="https://github.com/neilfws/earthquakes/tree/master/newzealand">Github repository</a> and <a target="_blank" rel="nofollow" href="http://rpubs.com/neilfws/229230">a report</a> published at RPubs. Thanks to Florian Teschner for a <a target="_blank" rel="nofollow" href="http://flovv.github.io/Gas_price-Mapping/">great ggmap tutorial</a> which got me started.</p>
<p>My own work in bioinformatics to date has not (sadly!) required much analysis of geospatial data but I can see use cases in many areas – environmental microbiology, for example.</p>
<p>Filed under: <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/category/statistics/r/">R</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/category/statistics/">statistics</a> Tagged: <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/earthquakes/">earthquakes</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/ggplot2/">ggplot2</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/maps/">maps</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/new-zealand/">new zealand</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/visualisation/">visualisation</a> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nsaunders.wordpress.com/4394/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/nsaunders.wordpress.com/4394/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/putting-data-on-maps-using-r-easier-than-ever/"></div></div><div><a data-url="https://www.r-bloggers.com/putting-data-on-maps-using-r-easier-than-ever/" data-counturl="https://www.r-bloggers.com/putting-data-on-maps-using-r-easier-than-ever/" data-count="vertical" data-text="Putting data on maps using R: easier than ever" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://nsaunders.wordpress.com/2016/11/24/putting-data-on-maps-using-r-easier-than-ever/"> R – What You're Doing Is Rather Desperate</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/Iy8EAn7Lj2U"></a></div>