eq_map: Map earthquakes

Description Usage Arguments Value Examples

Description

This function creates an interactive leaflet map with the earthquake locations.

Usage

1
eq_map(data, annot_col = "DATE")

Arguments

data

A data frame or tibble with spatial coordinates (LONGITUDE, LATITUDE) and the earthquake magnitude (EQ_PRIMARY).

annot_col

A column contained in data whose information will be displayed in the pop-up window.

Value

An interactive leaflet map with the earthquake locations. The marker size is proportional to the earthquake magnitude (EQ_PRIMARY). When clicking on a marker, a pop-up window will open.

Examples

1
2
3
4
5
6
7
# date pop-up as in figure 1 of module 3
file <- system.file("extdata", "earthquakes.tsv.gz", package = "NOAAeq")
library(magrittr)
readr::read_delim(file = file, delim = "\t") %>%
  eq_clean_data() %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
  eq_map(annot_col = "DATE")

la-sch/NOAAeq documentation built on May 20, 2019, 7:31 p.m.