eq_create_label: Create HTML code to be showed in the marker's popup

Description Usage Arguments Value Examples

Description

This function generates an HTML code that can be dispalyed in the popup of a leaflet map. Four items are displayed, each on a separate line: date, location, magnitude and total deaths. If any of the variables is NA, the entire line is not included. If none of the variables are present in the data frame, the annotation would be empty.

Usage

1

Arguments

data

a data frame from which extracting the required information to be showed as popup

Value

character vector containing HTML code

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
annot <- eq_create_label(data)

data %>%
  dplyr::filter(COUNTRY == "ITALY" & lubridate::year(DATE) >= 1000) %>%
  dplyr::mutate(popup_text = eq_create_label(.))


## End(Not run)

frenkg/coursera.eq documentation built on May 12, 2019, 1:04 p.m.