eq_create_label: eq_create_label

Description Usage Arguments Value Examples

Description

This function contructs a vector of html-formatted strings by using the input data's location, magnitude, total_deaths columns. Those columns are titled accordingly. If, for any of the rows, one of the values is missing, that particular part of the annotation will be excluded.

Usage

1
2
eq_create_label(data, location = "LOCATION_NAME", magnitude = "EQ_PRIMARY",
  total_deaths = "TOTAL_DEATHS")

Arguments

data

A Dataframe Object containing the data to create the html annotations. Defaults to "LOCATION_NAME".

location

Name (char) of the column in data depicting the location to be annotated. Defaults to "EQ_PRIMARY".

magnitude

Name (char) of the column in data depicting the magnitude to be annotated. Defaults to "TOTAL_DEATHS".

total_deaths

Name (char) of the column in data depicting the total_deaths to be annotated

Value

This function returns a character vector of HTML-formmated strings, labeling the location, magnitude, and total_deaths values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

readr::read_delim("data/signif.txt", 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)

ronybsulca/earthquakeGeoms documentation built on May 6, 2019, 5:03 p.m.