Description Usage Arguments Details Value See Also Examples
eq_map
creates an interactive leaflet
map
showing the location of earthquakes in the given quakes
data set.
1 |
data |
The |
annot_col |
The column to use for the popup annotation. You may use a
single column; otherwise create a more useful label first by using the
|
This function shows an interactive map of the location of the earthquakes in
the given quakes
data. The size of the circles are
proportional to the magnitude of the earthquakes (in the EQ_PRIMARY
)
variable. The map is interactive, and when you click on a link, the popup
shows the annotation as specified by the annot_col
variable.
Returns an interactive leaflet
map.
eq_create_label
to create a more useful popup
annotation in the quakes
data frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(lubridate); library(dplyr)
## use 'DATE' as annotation
quakes <- eq_load_clean_data() %>%
dplyr::filter(COUNTRY == 'JAPAN') %>%
dplyr::filter(lubridate::year(DATE) >= 2000)
eq_map(quakes, annot_col = 'DATE')
## Create a popup_text variable and use that for the label
quakes <- eq_load_clean_data() %>%
dplyr::filter(COUNTRY == 'JAPAN') %>%
dplyr::filter(lubridate::year(DATE) >= 2000) %>%
dplyr::mutate(popup_text = eq_create_label(.))
eq_map(quakes, annot_col = 'popup_text')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.