eq_map: This function uses leaflet to plot latitude and longitude for...

Description Usage Arguments Value Examples

View source: R/mapping_tools.R

Description

This function uses leaflet to plot latitude and longitude for earthquake epicenters on a map. The map is fully interactive and the epicenter markers are clickable which provides a short text that is grabbed from a column chosen by the caller of the function. The radius of the epicenter markers is based on the earthquake's magnitude.

Usage

1
eq_map(df, annot_col)

Arguments

df

The data frame containing the NOAA earthquake data.

annot_col

The column containing the text displayed when an epicenter marker is clicked.

Value

The leaflet htmlwidget containing the interactive map with earthquake visualization overlayed.

Examples

1
2
3
4
readr::read_delim(file = system.file("extdata", "signif.txt", package="noaa"), delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
eq_map(annot_col = "DATE")

chrpihl/noaa documentation built on May 25, 2019, 3:26 p.m.