eq_map: Make an Earthquake interactive map

Description Usage Arguments Value Examples

Description

Function eq_map() takes an argument data containing the filtered data frame with earthquakes to visualize. 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. The user is able to choose which column is used for the annotation in the pop-up with a function argument named annot_col. Each earthquake is represented as a circle, and the radius of the circle is proportional to the earthquake's magnitude (EQ_PRIMARY).

Usage

1
eq_map(data, annot_col = "EQ_PRIMARY")

Arguments

data

Dataframe with earthquake data. Structure and columns names must be the same as in NOAA earthquake database.

annot_col

Name of the column in the data frame used for popup annotation.

Value

leaflet map object

Examples

1
2
3
4
5
6
filename <- system.file("extdata", "earthquakes.tsv.gz", package = "earthquakes")
readr::read_delim(filename, delim = "\t") %>%
  eq_clean_data() %>%
  dplyr::filter(COUNTRY == "MEXICO" & as.integer(YEAR) >= 2000) %>%
  dplyr::mutate(popup_text = eq_create_label(.)) %>%
  eq_map(annot_col = "popup_text")

flyeye/earthquakes documentation built on May 16, 2019, 1:42 p.m.