eq_create_label: Creates an HTML label to use in Popup text for Location,...

Description Usage Arguments Value Examples

Description

Creates an HTML label that can be used as the annotation text in the leaflet map. This function put together a character string for each earthquake that will show the cleaned location , the magnitude (EQ_PRIMARY), and the total number of deaths (TOTAL_DEATHS), with boldface labels for each ("Location", "Total deaths", and "Magnitude"). If an earthquake is missing values for any of these, both the label and the value will be skipped for that element of the tag.

Usage

1
eq_create_label(data_eq)

Arguments

data_eq

Filtered dataframe of NOAA earthquakes dataset

Value

Popup text in Html lable for Location, Magnitude and Total number of Deaths

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
 eq_create_label(data_eq)

 data_eq %>%
       dplyr::filter(COUNTRY %in% COUNTRIES & lubridate::year(DATE) >= 2000) %>%
       dplyr::mutate(popup_text = eq_create_label(.)) %>%
       eq_map(annot_col = "popup_text")

## End(Not run)

garvish/earthquakes documentation built on May 16, 2019, 5:41 p.m.