eq_create_label: Popup Label for Earthquake Map

Description Usage Arguments Details Value Examples

View source: R/leaflet_map.R

Description

eq_create_label creates a more descriptive and HTML-formatted popup label to be used in eq_map.

Usage

1

Arguments

data

The quakes data frame.

Details

This function creates a vector of HTML-formatted labels using supplied quakes data. The function creates lines of the format Label: value from the following variables in the quakes data set:

Any of the above variables with missing/NA values are skipped in the label.

Value

A vector with the HTML-formatted labels. You should include this vector with the data frame that is sent to eq_map.

Examples

1
2
3
4
5
6
7
library(dplyr); library(lubridate)
## Create a popup_text variable and use that for the label
quakes <- eq_load_clean_data() %>%
 dplyr::filter(COUNTRY == 'JAPAN') %>%
 dplyr::filter(lubridate::year(DATE) >= 2000) %>%
 dplyr::mutate(popup_text = eq_create_label(.))
eq_map(quakes, annot_col = 'popup_text')

DYZI/Earthquake documentation built on May 7, 2019, 6:54 p.m.