eq_create_label: Create informative pop-ups for the interactive map created...

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 in Module 1), 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
eq_create_label(df_clean)

Arguments

df_clean,

a dataframe obtained after runing functions eq_clean_data() and eq_location_clean(). Initial raw data should be downloaded from NOAA website#'

Value

This function creates HTML label with annotations

Examples

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

Liddlle/capstone documentation built on June 5, 2019, 8:49 p.m.