This package specializes in visualizing a set of earthquake date from the National Centers for Environmental Information (NOAA). It will provide both a visualization of time as well as location.
It provides two custom Geom_*'s that will allow the user to utilize ggplot2, two functions to create an interactive map widget, and two functions to clean the raw NOAA data set, which is comes with the package and has already been cleaned.
Will create the essential layer
Will create the annotation layer
Creates the label for the annotation of the map widget. The label will display location, magnitude, and number of deaths, if applicable.
This will create the interactive map widget.
Creates the Date Column
Removes country in the location name field.
ggplot(noaa[noaa$COUNTRY=="CHINA", ] , aes(DATE, COUNTRY, size=EQ_MAG_MW, colour=DEATHS)) + geom_timeline(xmin="-1000-01-01", xmax="1000-01-01") + theme_classic() + theme(legend.position="bottom", axis.line.y=element_blank()) + labs(y=NULL) +
geom_timeline_label(aes(label=LOCATION_NAME), n_max=10,xmin="-1000-01-01", xmax="1000-01-01")
noaa %>% eq_clean_data() %>% eq_location_clean() %>% dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>% eq_map(annot_col = "DATE")
noaa %>% eq_clean_data() %>% eq_location_clean() %>% dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>% 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.