Dec 8, 2017

Live Earthquakes App

It's awesome when you are asked to build a product demo and you end up building something you actually use yourself.

That is what happened to me with the Live Earthquake Shiny App.  A few months ago, as part of the JHU Data Science Specialization course, I was tasked to build a data product demo using the shiny package in R. I'd already had some experience with shiny, but this time I wanted to build an app showing real-time data. Something people would like to monitor regularly and see if something special happened during the last couple of days.

I am not at all an expert on earthquakes, but I thought this would make a great use case for a real-time data visualization. And now, every time I hear from the news of a new earthquake episode I go to double check it in my app and see what else is going on.

The app does the following:

  • Retrieve the latest version of data available from USGS website. Data comes in a .csv file and reports quakes for the past 7 days (check the exact URL in the R code).
  • Subset the dataset in case the user chooses to see only data from yesterday.
  • Plot earthquake data on a world map using the leaflet library.
  • Calculate a few basic metrics like max and number of occurrences.
  • Force a manual refresh of data if the user press the button “Update Data”.
Here is a snapshot of the app. You can use the app here in shinyapps.io server.

live earthquakes map


Also you check out the code here.

If you click on each circle some basic info about the quake are shown: place, time, magnitude and depth. Circles colors are based on the magnitude (the darker the stronger). If you wonder how I classified them from minor to strong below is the scale I used:

magnitude categorization

Hope you'll have a chance to explore it! Enjoy.

4 comments:

  1. Great beat ! I wish to apprentice while you amend your site, how can i subscribe for a blog site? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear idea reputation management online services

    ReplyDelete
  2. I'm really enjoying the theme/design of your blog. Do you ever run into any web browser compatibility issues? A few of my blog readers have complained about my site not operating correctly in Explorer but looks great in Chrome. Do you have any suggestions to help fix this issue? search engine marketing solutions

    ReplyDelete
  3. Hmm it looks like your website ate my first comment (it was extremely long) so I guess I'll just sum it up what I wrote and say, I'm thoroughly enjoying your blog. I too am an aspiring blog writer but I'm still new to the whole thing. Do you have any tips for beginner blog writers? I'd definitely appreciate it. truck rental singapore

    ReplyDelete
  4. Good day! This is my first comment here so I just wanted to give a quick shout out and say I truly enjoy reading through your blog posts. Can you recommend any other blogs/websites/forums that go over the same topics? Thanks a ton! internet marketing

    ReplyDelete