Description Usage Arguments Value Examples
View source: R/eq_create_label.R
This function creates labels for an interactive map using three
columns from a data.frame (the data
variable). By default these are the
"LOCATION" (the line_1
variable), "EQ_PRIMARY" (the line_2
variable) AND "TOTAL_DEATHS" (the line_3
variable) columns. It will
omit all NA
info from the label text, and returns a vector that can be
used as popuptext column in the data.frame as label text in the eq_map function.
1 2 | eq_create_label(data = NULL, line_1 = "LOCATION", line_2 = "EQ_PRIMARY",
line_3 = "TOTAL_DEATHS")
|
data |
a data.frame containing columns named: "LOCATION" LOCATION info of earthquake events "EQ_PRIMARY" size of earthquake events on Richter scale "TOTAL_DEATHS" Total deaths info of earthquake events |
line_1 |
the name of a column in |
line_2 |
the name of a column in |
line_3 |
the name of a column in |
character vector containing popup-text
1 2 3 4 5 6 7 8 9 | ## Not run:
# assuming earthquake data is in the file earthquakes.tvs.gz in the wd
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.