eq_create_label: Function eq_create_label

Description Usage Arguments Examples

Description

eq_create_label() 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 puts 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

Arguments

df

- A dataframe of containing 3 columns LABELS,EQ_PRIMARY and DEATHS.

Examples

1
2
3
4
library(magrittr)
labels<-readr::read_delim(system.file("extdata", "signif.txt", package="Earthquake"), delim = "\t")
lables<-labels %>% eq_clean_data %>% eq_create_label
head(labels)

MaxSunshine/Earthquake documentation built on May 28, 2019, 1:51 p.m.