eq_map: Plot earthquakes on the map

Description Usage Arguments Value Examples

Description

This function plots earthquakes from data generated by U.S. National Oceanographic and Atmospheric Administration (NOAA) database on the map. The function maps the epicenters (LATITUDE/LONGITUDE) and annotates each point with in pop up window containing annotation data stored in a column of the data frame.

Usage

1
eq_map(data, annot_col)

Arguments

data

A preproccessed tibble (data.frame) of NOAA earthquakes dataset

annot_col

column used for the annotation in the pop-up

Value

This function returns a ggplot

Examples

1
2
3
4
library(dplyr)
NOAA_clean_data = eq_clean_data("https://www.ngdc.noaa.gov/nndc/struts/results?type_0=Exact&query_0=$ID&t=101650&s=13&d=189&dfn=signif.txt")
NOAA_clean_data %>% dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>% eq_map(annot_col = "DATE")
NOAA_clean_data %>% dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>% dplyr::mutate(popup_text = eq_create_label(.)) %>% eq_map(annot_col = "popup_text")

androsova/NOAA documentation built on May 10, 2019, 11:44 a.m.