eq_create_label: Create annotation label: 'eq_create_label()'

Description Usage Arguments Value Examples

Description

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 should put together a character string for each earthquake that will show the cleaned location (as cleaned by the eq_location_clean() function created above, 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 should be skipped for that element of the tag.

Usage

1

Arguments

data

A data frame of the clean data

Value

An HTML label annotating each point with the date(DATE), the cleaned location name(LOCATION_NAME), the magnitude (EQ_PRIMARY) and the total number of deaths(TOTAL_DEATHS) in pop up window.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
library(dplyr)
data(raw_df)
raw_df %>% eq_clean_data() %>%
dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
dplyr::mutate(popup_text = eq_create_label(.)) %>%
eq_map(annot_col = "popup_text")

## End(Not run)

atibot/eqplot documentation built on May 17, 2019, 4 p.m.