eq_create_label: Create an HTML pop-up label showing location, magnitude and...

Description Usage Arguments Value Examples

View source: R/eq_create_label.R

Description

eq_create_label takes a NOAA data.frame with columns clean_location, EQ_PRIMARY and TOTAL_DEATHS and produces a vector of strings contituting HTML encoded labels showing the location, magnitude and total, associated deaths caused the each quake.

Usage

1

Arguments

data

is a data.frame with clean_location, EQ_PRIMARY and TOTAL_DEATHS columns. The data in these columns is used to generate HTML encoded label strings.

Value

a vector of HTML encoded, label strings.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(quake)
library(readr)
library(dplyr)
library(lubridate)

data_file_name <- system.file("extdata", "earthquakes.tsv.gz", package = "quake")

read_delim(data_file_name, delim = "\t") %>%
  eq_clean_data()                                       %>%
  filter(COUNTRY == "MEXICO" & year(date) >= 2000)      %>%
  mutate(popup_text = eq_create_label(.))               %>%
  eq_map(annot_col = "popup_text")

RussellPolitzky/quake documentation built on May 23, 2019, 10:35 p.m.