eq_create_label: eq_create_label

Description Usage Arguments Value Examples

View source: R/eq_create_label.R

Description

This function creates content to be displayed inside of the popups plotted by the eq_map function.

Usage

1
eq_create_label(df_create_label = rlang::.data)

Arguments

df_create_label

DataFrame with information about earthquakes, must have LOCATION, EQ_PRIMARY, and TOTAL_DEATHS columns

Value

Vector with content to be used by eq_map function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Full example using eq_clean_data, eq_create_label, and eq_map.
readr::read_delim("inst/extdata/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")

# From a given dataframe (assuming my_dataframe has LOCATION, EQ_PRIMARY, and TOTAL_DEATHS columns).
my_dataframe %>%
    plyr::mutate(popup_text = eq_create_label(.)) %>%
        eq_map(annot_col = "popup_text")
## End(Not run)

nandinigntr/MSDR documentation built on Jan. 1, 2021, 11:32 a.m.