eq_map: Function to create interactive map

Description Usage Arguments Value Examples

View source: R/eq_map.R

Description

This function creates an interactive map using a data.frame with columns "LATITUDE", LONGITUDE" for marker position and "EQ_PRIMARY" for marker size. Furthermore, the function creates popup_info labels based on the annot_col column present in the data.frame. It returns an interactive map with popup-text annotations.

Usage

1
eq_map(data = NULL, annot_col = "DATE")

Arguments

data

a data.frame containing columns named: LATITUDE: latitude info of earthquake events LONGITUDE: longitude info of earthquake events EQ_PRIMARY: size of earthquake event on Richter scale

annot_col

the name of a column present in data to be used as annotation text in the interactive map

Value

leaflet interactive map

Examples

1
2
3
4
5
6
7
8
## Not run: 
# assuming earthquake data is in the file earthquakes.tvs.gz in the wd
readr::read_delim("earthquakes.tsv.gz", delim = "\t") %>%
    eq_clean_data() %>%
    dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
    eq_map(annot_col = "DATE")

## End(Not run)

RMHoek/NOAAearthquakeAnalysis documentation built on May 14, 2019, 8:58 a.m.