eq_create_label: eq_create_label function

Description Usage Arguments Value Examples

View source: R/map.R

Description

This function receives the earthquake data set and builds an annotation_text in html format that can be displayed as a pop-up on the map. The function checks to see if the LOCATION_NAME, EQ_PRIMARY and DEATHS for each earthquake contains a valid value and will add the lines if they are valid. Otherwise, it will simply skip the specific field.

Usage

1
eq_create_label(df_data)

Arguments

df_data

The data set containing the earthquake information

Value

A character vector containing the annotation text in html format

Examples

1
2
3
4
5
6
7
8
## Not run: 
readr::read_delim("earthquakes.tsv.gz", delim = "\t") %>%
 eq_clean_data() %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
  dplyr::mutate(popup_text = eq_create_label(.)) %>%
  eq_map(annot_col = "popup_text")

## End(Not run)

pvisser82/earthquakedata documentation built on May 19, 2019, 3:05 a.m.