eq_map: Function to draw an intercative leaflet map showing the...

Description Usage Arguments Value Examples

Description

The function generate a leaflet map and add a circle markers for every earthquake in the data set provided. The size of the markers is proportional to the magnitude of the earthquake. One variable of the data frame can be passed to the function to be displayed as a popup. If the intensity is not specified (often the case for old earthquakes), the marker is displayed in grey with fix radius = 1. If any of the required variable is not present in the data frama, the function stops nd no map will be plotted.

Usage

1
eq_map(data, annot_col = "DATE")

Arguments

data

a data frame containing the data to be plotted on the map: it should contain columns with LONGITUDE, LATITUDE, EQ_PRIMARY.

annot_col

a character string specifying which column should be displayed as annotation in the popups. Default = DATE

Value

a leaflet map whowing the earthquake's location and magnitude

Examples

1
2
3
4
5
6
 {
  eq_map(data)

  data %>%
  dplyr::filter(COUNTRY == "ITALY" & lubridate::year(DATE) >= 1000) %>%
  eq_map(annot_col = "DATE")

frenkg/coursera.eq documentation built on May 12, 2019, 1:04 p.m.