Description Usage Arguments Value Examples
View source: R/map_functions.R
This function creates a leaflet map from a NOAA Significant Earthquake dataframe.
1 2 3 | eq_map(data, annot_col = "")
eq_create_label(data)
|
data |
a dataframe from the NOAA Significant Earthquake dataframe. |
annot_col |
colummn name of the variable to be used for annotating the points. |
A leaflet map with the earthquake locations plotted as points, with radius proportional to the magnitude.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run: library(msdrCourseraCapstonePackage)
library(magrittr)
library(ggplot2)
library(dplyr)
library(lubridate)
library(readr)
data_path <- system.file("extdata", "signif.txt", package = "msdrCourseraCapstonePackage")
eq_data_raw <- read.delim(data_path)
eq_data <-
eq_data_raw %>%
eq_clean_data() %>%
eq_location_clean()
eq_data %>%
dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>%
eq_map(annot_col = "DATE")
eq_data %>%
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.