eq_map: Displays an R leaflet map with the quake's epicenters...

Description Usage Arguments Warning Examples

Description

eq_map shows an R leaflet map with the quakes' epicenters; it takes into account the earthquake's magnitude to display the radii. This function allows to include popup labels based on the contents of a variable (e.g., the quake's occurrence).

Usage

1
eq_map(data, annot_col)

Arguments

data

A tibble object with the earthquake epicenters.

annot_col

A character vector in HTML format with the text content to be displayed in the popup text labels of the R leaflet map.

Warning

In order to work, the following variables must exist in the data object: LONGITUDE, LATITUDE, and EQ_PRIMARY (magnitude).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
require(dplyr)
require(lubridate)

# Before showing the interactive map, we need to tidy the data up.
raw_data <- get_earthquake_data()
clean_data <- eq_clean_data(raw_data)
clean_data <- eq_location_clean(clean_data)

# Displays an R's leaflet map with the epicenters of the earthquakes that
# have occurred in Mexico as of 2000.  The interactive map has popup text
# labels with the date of occurrence.
clean_data %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
  eq_map(annot_col = "DATE")

Cesar-Urteaga/rnoaa documentation built on May 10, 2019, 5:16 a.m.