eq_map: Function to Display a World Map that Features Earthquake...

Description Usage Arguments Value Note Examples

View source: R/leaflt_map.R

Description

Function takes in the cleaned data and column to annotate on the map (if any) and returns an interactive world map with points plotted on it which denote the location of earthquakes. In case 'annot_col' is given a particular non null argument, the map features pop-ups on every pointthat contain information about that earthquake in elation to the argument passed through 'annot_col'.

Usage

1
eq_map(dat, annot_col = "Date")

Arguments

dat

An object of class data.frame or tibble or tbl_df that contains data on earthquakes.

annot_col

The name of the feature of the earthquakes to be annoted. For instance, Date, Deaths, MAgnitude, etc. The default is Date.

Value

A html widget called leaflet that features an interactive world map with earthquake locations.

Note

The 'annot_col' argument can only take valid column names from the Data provided as input. In any other case, the feature should be first concatenated withe the data frame and then then the data and the new feature should be passed to the function. Check documentation of the dataset used in this package to get an idea of the features already present in the data set. For further queries refer to the source https://www.ngdc.noaa.gov/hazel/view/hazards/earthquake/event-data

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
library(magrittr)
data(eaq_data)
eaq_data%>%
  eq_clean_data()%>%
  dplyr::filter(`Country` == "MEXICO" & lubridate::year(`Date`) >= 2000) %>%
  eq_map(annot_col = "Date")

## End(Not run)

Noob-Programr/noaa documentation built on Dec. 17, 2021, 5:26 a.m.