eq_map: Create an interactive map of historical earthquakes

Description Usage Arguments Details Value References See Also Examples

Description

Create an interactive map of historical earthquakes using the NOAA earthquake database included with this package. Earthquakes are plotted as circles with their radii proportional to the magnatude of the earthquakes. Optionally, labels can be passed which will pop up when the earthquake is clicked on the map

Usage

1
eq_map(data, annot_col = NULL)

Arguments

data

A dataframe with earthquake location columns LATITUDE and LONGITUDE, and magnatude column EQ_PRIMARY. The included EQ_NOAA dataframe is already correctly formateed, and is intended to be used with this function

annot_col

The character name of the column in data containing a character vector of optional popup text to be shown when the earthquake is clicked. Defaults to NULL, where no label is shown

Details

This function uses of the popular leaflet package, which creates interactive html maps within R

Value

An html map object, to which further Leaflet objects can be added

References

NOAA earthquake database: https://www.ngdc.noaa.gov/nndc/struts/form?t=101650&s=1&d=1

See Also

leaflet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data('clean_NOAA')
clean_NOAA %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
  eq_map(annot_col = "DATE")
data('clean_NOAA')
clean_NOAA %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
  dplyr::mutate(popup_text = eq_create_label(.)) %>%
  eq_map(annot_col = "DATE")

## End(Not run)

jmmark/QuakeCoursera documentation built on May 3, 2019, 5:18 p.m.