eq_map: Interactive Earthquake Map and Related Data

Description Usage Arguments Details Value See Also Examples

View source: R/map_tools.R

Description

Generates interactive earthquake map and related data.

Usage

1
eq_map(data, annot_col = "Date_ymd")

Arguments

data

The earthquakes data frame based on information taken from the NOAA earthquake databases. Because there is a lot of data, the user should filter to a single country or an adjacent group of countries.

annot_col

A column to use for the popup annotation. The user can select a single column; otherwise you can create a more informative label first by using the eq_create_label function.

Details

eq_map creates an interactive leaflet map showing the location of earthquakes in the given earthquakes data set.

This function shows an interactive map of the location of the earthquakes in the given earthquakes data. The size of the circles are proportional to the magnitude of the earthquakes (in the EQ_PRIMARY) variable. The map is interactive, and when you click on a link, the popup shows the annotation as specified by the annot_col variable.

Value

Returns an interactive leaflet map.

See Also

eq_create_label to create a more informative popup annotation in the earthquakes data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Using "Date_ymd" column as annotation
## Not run: 
earthquakes <- earthquakes %>%
   dplyr::filter(Country == 'China') %>%
   dplyr::filter(lubridate::year(Date_ymd) >= 2000)
eq_map(earthquakes, annot_col = 'Date_ymd')

earthquakes <- earthquakes %>%
 dplyr::filter(Country == 'China') %>%
 dplyr::filter(lubridate::year(Date_ymd) >= 2000) %>%
 dplyr::mutate(Popup_Text = eq_create_label(.)) %>%
 eq_map(annot_col = "Popup_Text")

## End(Not run)

SondergardM/MSDRCapstone documentation built on Dec. 18, 2021, 2:07 p.m.