Description Usage Arguments Value Examples
The function maps the epicenters (LATITUDE/LONGITUDE) and annotates each point with a pop up window containing annotation data stored in a column of the data frame. Each earthquake is shown with a circle, and the radius of the circle is proportional to the earthquake<e2><80><99>s magnitude (EQ_PRIMARY).
1 |
df |
a data containing the filtered data frame with earthquakes to visualize. |
annot_col |
the name of the column used for the annotation in the pop-up Defaults to "DATE". |
a leaflet
type HTML widget.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(dplyr)
# load data
filename <- system.file("extdata/earthquakes.tsv.gz", package = "quakeR")
raw_data <- readr::read_delim(filename, delim = "\t")
map_data <-
raw_data %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "MEXICO",
lubridate::year(DATE) >= 2000)
eq_map(map_data)
eq_map(map_data, annot_col = "EQ_PRIMARY")
eq_map(map_data, annot_col = "LOCATION_NAME")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.