eq_map: Map and Annotate Earthquakes

Description Usage Arguments Value Examples

View source: R/map_functions.R

Description

The function eq_map maps the epicenters of earthquakes and annotates each point with a pop up window.

Usage

1
eq_map(data, annot_col)

Arguments

data

A NOAA data frame with the columns LONGITUDE and LATITUDE of the earthquakes.

annot_col

The column of the data frame depicting the annotation of the earthquakes.

Value

The function outputs a map with epicenters of earthquakes as well as their annotations to the current graphics device.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# import libraries
library(dplyr)
library(readr)
# set working directory
setwd(system.file("extdata", package = "noaa"))
# read and clean NOAA data
data <- readr::read_delim("signif.txt", "\t") %>%
   eq_clean_data() %>%
   dplyr::filter(COUNTRY == "MEXICO", YEAR > 2000)
# map and annotate NOAA data
eq_map(data, annot_col = "DATE")

kfull/noaa documentation built on May 25, 2019, 8:29 p.m.