<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/mapping-earthquakes-off-the-irish-coast-using-the-leaflet-package-in-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://sw23993.wordpress.com/2018/04/22/mapping-earthquakes-off-the-irish-coast-using-the-leaflet-package-in-r/"> Environmental Science and Data Analytics</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Ireland is a typically stable region from a seismic activity perspective as it is distant from major plate boundaries where subduction and sea-floor spreading occur. However, in reading the following <a rel="nofollow" href="https://www.siliconrepublic.com/innovation/tsunami-detector-irish-coast-dias" target="_blank">article</a>, I was surprised to discover that earthquakes occur quite frequently both off the Irish coast and within the country itself. Most of these events occur as a result of tension and pressure release in the crustal rock.</p>
<p>The <a rel="nofollow" href="https://www.insn.ie/confirmed/" target="_blank">Irish National Seismic Network</a> (INSN) maintains a <a rel="nofollow" href="https://www.insn.ie/wp-content/uploads/2018/03/earthquakes.web_201708091.xlsx" target="_blank">dataset</a> on 144 local earthquakes dating back to February 1980. The variables in the dataset are event date, event time, latitude, longitude, magnitude, region and subjective intensity (with levels such as “felt”, “feltIII”, “feltIV”).</p>
<h2>Distribution of local earthquake magnitudes</h2>
<p>The median magnitude recorded since 1980 is 1.5 on the Richter Scale. The largest intensity recorded was magnitude 5.4 on the 19th July 1984 in the Lleyn Peninsula region of Wales. This event occurred near the village of <span>Llanaelhaearn and is the location of the biggest earthquake in the past 50 years.</span></p>
<p><img data-orig-file="https://sw23993.files.wordpress.com/2018/04/histogram.png?w=456" data-orig-size="571,359" data-medium-file="https://sw23993.files.wordpress.com/2018/04/histogram.png?w=456?w=300" data-attachment-id="2234" data-image-meta="{" data-image-description="" src="https://sw23993.files.wordpress.com/2018/04/histogram.png?w=456" data-permalink="https://sw23993.wordpress.com/2018/04/22/mapping-earthquakes-off-the-irish-coast-using-the-leaflet-package-in-r/histogram/" data-large-file="https://sw23993.files.wordpress.com/2018/04/histogram.png?w=456?w=571" alt="histogram" data-image-title="histogram" sizes="(max-width: 571px) 100vw, 571px" data-comments-opened="1" class="wp-image-2234" data-recalc-dims="1"></p>
<h2>Average waiting time between events</h2>
<p>How frequently do seismic events occur around Ireland and its coast? It turns out that the median time between events is just 25 days! The greatest interval (1,335 days) is between an event recorded in New Ross, Co. Waterford on the 19th April 2002 and a magnitude 2.8 in the Irish Sea on the 14th December 2005. The distribution of waiting times is plotted below with outliers included and removed.</p>
<p><img data-orig-file="https://sw23993.files.wordpress.com/2018/04/boxplots.png?w=456" data-orig-size="860,362" data-medium-file="https://sw23993.files.wordpress.com/2018/04/boxplots.png?w=456?w=300" data-attachment-id="2235" data-image-meta="{" data-image-description="" src="https://sw23993.files.wordpress.com/2018/04/boxplots.png?w=456" data-permalink="https://sw23993.wordpress.com/2018/04/22/mapping-earthquakes-off-the-irish-coast-using-the-leaflet-package-in-r/boxplots/" data-large-file="https://sw23993.files.wordpress.com/2018/04/boxplots.png?w=456?w=739" alt="boxplots" data-image-title="boxplots" sizes="(max-width: 739px) 100vw, 739px" data-comments-opened="1" class="wp-image-2235" data-recalc-dims="1"></p>
<h2>Geospatial mapping of earthquake distribution</h2>
<p>The leaflet package for R was used to map the data. This wonderful package allows one to create excellent interactive data visualisations. The map below is a static .png with no interactivity but it shows the distribution well.</p>
<p>With the interactive version, each data point can be investigated by clicking on it to bring up a box containing additional information about the event. Zooming in and out is also possible with the interactive version as is changing the base map layer and other aesthetics.</p>
<p><img data-orig-file="https://sw23993.files.wordpress.com/2018/04/geospatial.png?w=456" data-orig-size="834,549" data-medium-file="https://sw23993.files.wordpress.com/2018/04/geospatial.png?w=456?w=300" data-attachment-id="2236" data-image-meta="{" data-image-description="" src="https://sw23993.files.wordpress.com/2018/04/geospatial.png?w=456" data-permalink="https://sw23993.wordpress.com/2018/04/22/mapping-earthquakes-off-the-irish-coast-using-the-leaflet-package-in-r/geospatial/" data-large-file="https://sw23993.files.wordpress.com/2018/04/geospatial.png?w=456?w=739" alt="geospatial" data-image-title="geospatial" sizes="(max-width: 739px) 100vw, 739px" data-comments-opened="1" class="wp-image-2236" data-recalc-dims="1"></p>
<h2>Packages used</h2>
<p>H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2009.</p>
<p>Hadley Wickham, Romain Francois, Lionel Henry and Kirill Müller (2017). dplyr: A Grammar of Data Manipulation. R package version 0.7.4. <a rel="nofollow" href="https://cran.r-project.org/package=dplyr" target="_blank">https://CRAN.R-project.org/package=dplyr</a></p>
<p>Hadley Wickham and Jennifer Bryan (2017). readxl: Read Excel Files. R package version<br>
1.0.0. <a rel="nofollow" href="https://cran.r-project.org/package=readxl" target="_blank">https://CRAN.R-project.org/package=readxl</a></p>
<p>Joe Cheng, Bhaskar Karambelkar and Yihui Xie (2017). leaflet: Create Interactive Web Maps with the JavaScript ‘Leaflet’ Library. R package version 1.1.0. <a rel="nofollow" href="https://cran.r-project.org/package=leaflet" target="_blank">https://CRAN.R-project.org/package=leaflet</a></p>
<p>Ramnath Vaidyanathan, Yihui Xie, JJ Allaire, Joe Cheng and Kenton Russell (2018).<br>
htmlwidgets: HTML Widgets for R. R package version 1.0.<br>
<a rel="nofollow" href="https://cran.r-project.org/package=htmlwidgets" target="_blank">https://CRAN.R-project.org/package=htmlwidgets</a></p>
<p> </p>
<p> </p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://sw23993.wordpress.com/2018/04/22/mapping-earthquakes-off-the-irish-coast-using-the-leaflet-package-in-r/"> Environmental Science and Data Analytics</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 rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/mT7gAsw1d2w" height="1"></a></div>