eq_map: Earthquake maps

Description Usage Arguments Details Value Examples

View source: R/map.R

Description

Generate maps based on NOAA earthquake data

Usage

1
eq_map(data, annot_col)

Arguments

data

NOAA earthquake data in a clean dataframe (after a call to eq_clean_data)

annot_col

The column that will be taken for anotaion of the earthquakes

Details

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. The user should be able to choose which column is used for the annotation in the pop-up with a function argument named annot_col. Each earthquake should be shown with a circle, and the radius of the circle should be proportional to the earthquake's magnitude (EQ_PRIMARY).

Value

The leaflet map with the earthquake data

Examples

1
2
3
4
5
library(dplyr)
library(lubridate)
earthquake_data %>%
  filter(COUNTRY == "MEXICO" & year(DATE) >= 2000) %>%
  eq_map(annot_col = "DATE")

raggaraluz/mastering_r_capstone documentation built on May 29, 2019, 6:53 p.m.