eq_map: Earthquakes Data in an Interactive Map.

Description Usage Arguments Value Note References Examples

View source: R/capstoneproject.R

Description

The Earthquakes will be mapped centered with their latitude and longitude "epicenter". The epicenter is annotated based on an annot_col which the user can specify. In addition, if the user specifies "popup_text" then a call to eq_create_label generates the appropriate text for the popup.

Usage

1
eq_map(eq_clean = NULL, annot_col = "datetime")

Arguments

eq_clean

The clean earthquake data in a tbl_df object.

annot_col

Column in the tbl_df object to be used for annotation.

Value

This function returns an interactive map.

Note

If an invalid column name is provided, the function provides a warning and uses the LOCATION_NAME column as teh annotation column.

References

http://rstudio.github.io/leaflet/

Examples

1
2
3
4
5
6
7
## Not run: 
filename<-system.file("data","earthquakes_data.txt.zip",package="capstone")
eq_location_clean(eq_clean_data(eq_data_read(filename))) %>%
dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(datetime) >= 1980) %>%
eq_map(annot_col = "datetime")

## End(Not run)

rainiercito/Mastering_Software_Development_in_R documentation built on May 6, 2019, 6:06 p.m.