Intro

This package is a final stage of the Coursera Mastering R Software Development specialiation. The whole project was built under data provided by NCEI. NOAA's former three data centers have merged into the National Centers for Environmental Information (NCEI). NOAA's National Centers for Environmental Information (NCEI) is responsible for preserving, monitoring, assessing, and providing public access to the Nation's treasure of geophysical data and information. The main aim of the project is to provide a R package for preprocessing and viuzalizing the significant earthquake database. The Significant Earthquake Database contains information on destructive earthquakes from 2150 B.C. to the present that meet at least one of the following criteria: Moderate damage (approximately $1 million or more), 10 or more deaths, Magnitude 7.5 or greater, Modified Mercalli Intensity X or greater, or the earthquake generated a tsunami.

Usage

Loading packages and data:

library(EarthQuakeCapstone)
library(dplyr)
library(ggplot2)
library(lubridate)

df = eq_ReadQuake()

Preprocessing Data:

df_tidy =  eq_CleanData(df)

Plot a Time Line:

df_tidy %>%
filter_at(c("COUNTRY"),all_vars(.%in% c("TURKEY","ITALY"))) %>%
  filter(.data$DATE > lubridate::origin) %>%
  eq_GenLocationName() %>%
  ggplot2::ggplot(ggplot2::aes(x = DATE, y = COUNTRY, fill = DEATHS, size = MAGNITUDE)) +
  geom_TimeLine()

Plot a Time Line with Lable:

df_tidy %>%
dplyr::filter_at(c("COUNTRY"),all_vars(.%in% c("TURKEY","ITALY"))) %>%
  dplyr::filter(.data$DATE > lubridate::origin) %>%
  eq_GenLocationName() %>%
  ggplot2::ggplot(ggplot2::aes(x = DATE, y = COUNTRY, fill = DEATHS, size = MAGNITUDE)) +
  geom_TimeLine() +
  geom_TimeLineLable(aes(label=LOCATION),check.overlap=T)

Plot a leaftlet map:

df_tidy %>%
  eq_GenLocationName() %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 1980) %>%
  eq_Map(label = "DATE")

Plot a leaftlet map with labels:

df_tidy %>%
  eq_GenLocationName() %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 1980) %>%
  eq_CreateLabel() %>%
  eq_Map(label = "popup_text")


Polkas/EarthQuakeCapstone documentation built on May 29, 2019, 2:49 p.m.