eq_create_label: Creates popup text for markers.

Description Usage Arguments Value Examples

View source: R/eq_create_label.R

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), the magnitude (EQ_PRIMARY), and the total number of deaths (TOTAL_DEATHS), with boldface labels for each ("Location", "Total deaths", and "Magnitude").

Usage

1
eq_create_label(eq_clean = NULL)

Arguments

eq_clean

The clean earthquake data in a tbl_df object.

Value

This function returns a character vector containing popup text to be used in a leaflet visualization.

Examples

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

## End(Not run)

JulianTWolf/RCapstone documentation built on May 3, 2019, 4:02 p.m.