eq_map: Creates interactive map visualization of NOAA earthquake...

Description Usage Arguments Value Note References Examples

Description

This function generates a map visualization for the NOAA earthquake data. The data should be subsetted in order to create an understandable visualization. The earthquakes are mapped based on the latitude and longitude of the earthquake epicenter. The function is a wrapper function and calls the leaflet function to generate the map. 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 = "DATE")

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
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

filename<-system.file("extdata","earthquakes_data.txt.gz",package="earthquakesViz")
readr::read_delim(filename, delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
eq_map(annot_col = "DATE")


filename<-system.file("extdata","earthquakes_data.txt.gz",package="earthquakesViz")
readr::read_delim(filename, delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
dplyr::mutate(popup_text = eq_create_label(.)) %>%
eq_map(annot_col = "popup_text")


## End(Not run)

leigitcode/earthquakesViz documentation built on May 7, 2019, 11:14 a.m.