The goal of noaa is to visualize earthquake data obtained from U.S. National Oceanographic and Atmospheric Administration (NOAA): Earthquake Database. NOAA National Centers for Environmental Information. doi:10.7289/V5TD9V7K
You can install the development version of noaa from GitHub with:
# install.packages("devtools")
devtools::install_github("philippB-on-git/noaa")
The package provides functionality to read, clean and visualize noaa data:
library(dplyr)
library(noaa)
noaa_data <- system.file("extdata", "noaa_earthquakes.tsv", package = "noaa") %>%
eq_read_data %>%
eq_clean_data %>%
filter(COUNTRY %in% c("MEXICO", "JAPAN") & YEAR > 1800)
timeline <- noaa_data %>%
plot_eq_timeline(label = NULL)
timeline +
geom_timeline_label(data = noaa_data, mapping = ggplot2::aes(y = COUNTRY, label = LOCATION_NAME), n_max = 3)
#> Warning: Removed 4 rows containing missing values (ggproto_timeline).
Mapping of earthquake locations on maps:
noaa_data %>%
mutate(info_text = eq_create_label(.)) %>%
eq_map(annot_col = "info_text")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.