Description Usage Arguments Value Examples
Function eq_map() takes an argument data containing the filtered data frame with earthquakes to visualize. The function maps the epicenters (LATITUDE/LONGITUDE) and annotates each point with in pop up window containing annotation data stored in a column of the data frame. The user is able to choose which column is used for the annotation in the pop-up with a function argument named annot_col. Each earthquake is represented as a circle, and the radius of the circle is proportional to the earthquake's magnitude (EQ_PRIMARY).
1 |
data |
Dataframe with earthquake data. Structure and columns names must be the same as in NOAA earthquake database. |
annot_col |
Name of the column in the data frame used for popup annotation. |
leaflet map object
1 2 3 4 5 6 | filename <- system.file("extdata", "earthquakes.tsv.gz", package = "earthquakes")
readr::read_delim(filename, delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "MEXICO" & as.integer(YEAR) >= 2000) %>%
dplyr::mutate(popup_text = eq_create_label(.)) %>%
eq_map(annot_col = "popup_text")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.