knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

NOAAsignifEarthQuakes

Travis build status

This package is the result of the Mastering Software Developmentin R Capstone project. This course proposed by Johns Hopkins University was created adn taught by Roger D. Peng and Brooke Anderson of

This project is centered around a dataset obtained from the U.S. National Oceanographic and Atmospheric Administration (NOAA). Source: National Geophysical Data Center / World Data Service (NGDC/WDS); Significant Earthquake Database; NOAA. doi:10.7289/V5TD9V7K. This dataset is focussed on significant earthquakes around the world and contains information about 5,933 earthquakes over an approximately 4,000 year time span.

The goal of NOAAsignifEarthQuakes is to:

  1. Read and clean data from the National Oceanographic and Atmospheric Administration (NOAA) Significant Earthquake Database
  2. Provide exploratory visualization tools:
    1. Timelines of earthquakes by countries
    2. Mapping of earthquakes in a specific region

Example

Loading the package

library(NOAAsignifEarthQuakes)
library(magrittr)

Reading and cleaning the data

## set the file input
file_noaa <- system.file("extdata","signif.txt",
                         package="NOAAsignifEarthQuakes",
                         mustWork=TRUE)
## Read and clean data
noaa <- load_NOAA_db(file_noaa) %>% eq_clean_data()
knitr::kable(tail(noaa))

Display a timeline

geom_timeline(noaa,
              mapping=ggplot2::aes(size=MAG,fill=DEATHS),
              countries='USA',
              xmin='2000-01-01',
              xmax='2017-01-01')

Display a timeline with labels

g <- geom_timeline(noaa,
                   mapping=ggplot2::aes(size=MAG,fill=DEATHS,y=COUNTRY),
                   countries=c('USA','China'),
                   xmin='2000-01-01',
                   xmax='2017-01-01') 
g + geom_timeline_label()

Display map of Earthquakes locations

filt_noaa <- noaa %>% dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000)
m <- eq_map(filt_noaa,annot_col = "popup_text")

The map is fully interactive, for documentation purposes we show the following static version.

map_png <- "README-map_mexico-1.png"
mapview::mapshot(m, file = map_png)
knitr::include_graphics(map_png)


BreizhZut/NOAAsignifEarthQuakes documentation built on Nov. 10, 2019, 3:45 p.m.