This vignette provides a meaningful description of the package earthquakeR and how it should be used. The usage of all the functions are decsribed one by one
library(earthquakeR) library(dplyr) library(ggplot2) library(grid) library(leaflet) library(lubridate) library(magrittr) library(readr) library(stringi) #knitr::opts_chunk$set(echo = TRUE, tidy = TRUE)
data <- eq_data() head(data)
data <- eq_clean_data(data) %>% eq_location_clean() head(data)
g <- data %>% dplyr::filter(year(DATE) > 2000 & COUNTRY %in% c("CANADA")) %>% dplyr::mutate(TOTAL_DEATHS = as.numeric(TOTAL_DEATHS), EQ_PRIMARY = as.numeric(EQ_PRIMARY)) %>% ggplot2::ggplot(ggplot2::aes(x = DATE, y = COUNTRY, colour = TOTAL_DEATHS, size = EQ_PRIMARY )) + geom_timeline() g
g <- data %>% dplyr::filter(year(DATE) > 2000 & COUNTRY %in% c("CANADA")) %>% dplyr::mutate(TOTAL_DEATHS = as.numeric(TOTAL_DEATHS), EQ_PRIMARY = as.numeric(EQ_PRIMARY)) %>% ggplot2::ggplot(ggplot2::aes(x = DATE, y = COUNTRY, colour = TOTAL_DEATHS, size = EQ_PRIMARY )) + geom_timeline() + labs(size = "Richter scale value", color = "# deaths") + geom_timeline_label(ggplot2::aes(label = LOCATION_NAME), n_max = 3) g
data %>% dplyr::filter(YEAR > 2000 & neg.date == 0 & COUNTRY %in% c("MEXICO")) %>% dplyr::mutate(popup_text = eq_create_label(.)) %>% eq_map(annot_col = "popup_text")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.