eq_map: Plot earthquakes on an interactive map

Description Usage Arguments Value Examples

View source: R/map_leaflet.R

Description

The function maps the epicenters (LATITUDE/LONGITUDE) and annotates each point with a pop up window containing annotation data stored in a column of the data frame. Each earthquake is shown with a circle, and the radius of the circle is proportional to the earthquake<e2><80><99>s magnitude (EQ_PRIMARY).

Usage

1
eq_map(df, annot_col = "DATE")

Arguments

df

a data containing the filtered data frame with earthquakes to visualize.

annot_col

the name of the column used for the annotation in the pop-up Defaults to "DATE".

Value

a leaflet type HTML widget.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(dplyr)

# load data
filename <- system.file("extdata/earthquakes.tsv.gz", package = "quakeR")
raw_data <- readr::read_delim(filename, delim = "\t")

map_data <-
  raw_data %>%
  eq_clean_data() %>%
  dplyr::filter(COUNTRY == "MEXICO",
                lubridate::year(DATE) >= 2000)

eq_map(map_data)
eq_map(map_data, annot_col = "EQ_PRIMARY")
eq_map(map_data, annot_col = "LOCATION_NAME")

vadimus202/quakeR documentation built on May 19, 2019, 1:47 a.m.