Description Usage Arguments Warning Examples
eq_map
shows an R leaflet map with the quakes' epicenters; it takes
into account the earthquake's magnitude to display the radii. This function
allows to include popup labels based on the contents of a variable (e.g., the
quake's occurrence).
1 |
data |
A tibble object with the earthquake epicenters. |
annot_col |
A character vector in HTML format with the text content to be displayed in the popup text labels of the R leaflet map. |
In order to work, the following variables must exist in the data
object: LONGITUDE, LATITUDE, and EQ_PRIMARY (magnitude).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require(dplyr)
require(lubridate)
# Before showing the interactive map, we need to tidy the data up.
raw_data <- get_earthquake_data()
clean_data <- eq_clean_data(raw_data)
clean_data <- eq_location_clean(clean_data)
# Displays an R's leaflet map with the epicenters of the earthquakes that
# have occurred in Mexico as of 2000. The interactive map has popup text
# labels with the date of occurrence.
clean_data %>%
dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
eq_map(annot_col = "DATE")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.