Description Usage Arguments Value Examples
This function takes the dataset as an argument and creates an
HTML label that can be used as the annotation text in the leaflet map. This
function puts together a character string for each earthquake that shows
the cleaned location (as cleaned by the eq_location_clean()
function, the magnitude (EQ_PRIMARY
), and the total number of deaths
(TOTAL_DEATHS
). If an earthquake is missing values for any of these,
both the label and the value are skipped for that element of the tag.
1 | eq_map_add_popup(eq_data)
|
eq_data |
a dataframe with NOAA's earthquake data. |
The original dataframe with a new column called popup_text
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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_add_popup()
eq_map(map_data, annot_col = "popup_text")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.