eq_create_label: HTML labeler for earthquakes leaflet map

Description Usage Arguments Value Examples

View source: R/NOAAviz.R

Description

eq_create_label takes a row of the dataset as an argument and creates an HTML label that can be used as the annotation text in the leaflet map." It puts 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 is skipped for that element of the tag." (Mastering Software Development in R Capstone, Week 3)

Usage

1

Arguments

row

a row of cleaned NOAA earthquake data to create a label for

Value

an html label string to add to an earthquake leaflet map object

Examples

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

## End(Not run)

jdallmann/NOAAviz documentation built on Nov. 4, 2019, 2:35 p.m.