eq_create_label: Pop-up annotations in interactive map

Description Usage Arguments Value Examples

View source: R/hello.R

Description

This function should put together a character string for each earthquake that will show the cleaned location, the magnitude, and the total number of deaths (TOTAL_DEATHS), with boldface labels for each ("Location", "Total deaths", and "Magnitude").

Usage

1
eq_create_label(clean_data)

Arguments

clean_data

The clean earthquake data

Value

A character vector containing the pop-up text to be used in a leaflet visualization.

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)

marioles/rcapstone documentation built on Sept. 16, 2020, 8:23 a.m.