knitr::opts_chunk$set(echo = FALSE, eval = FALSE, message = FALSE, warning = FALSE)
This package contains following functions.
It adds the column DATE and changes the type of LONGITUDE and LATITUDE columns.
raw.noaa.df <- readr::read_tsv(system.file("extdata", "signif.txt", package = "NOAA")) noaa.df <- NOAA::eq_clean_data(raw.noaa.df) str(noaa.df)
It removes the country name from LOCATION_NAME column and makes it to title case. It also has an internal call to eq_clean_data().
raw.noaa.df <- readr::read_tsv(system.file("extdata", "signif.txt", package = "NOAA")) noaa.df <- NOAA::eq_location_clean(raw.noaa.df) str(noaa.df)
The wrapper function for geom_timeline. Renders the timeline based on countries parameter. Providing "*" to countries parameter returns a timeline without any country axis. On providing a vector of countries it will produce the timeline for only those countries.
NOAA::get_timeline(noaa.df, "*","2000-01-01","2010-01-01") NOAA::get_timeline(noaa.df, c("CHINA", "INDIA"),"2000-01-01","2010-01-01")
For the output of get_timeline we could add the geom "geom_timeline_label()" which will add label to "n" number of earthquakes.
NOAA::get_timeline(noaa.df, c("CHINA", "INDIA"),"2000-01-01","2010-01-01") + NOAA::geom_timeline_label(ggplot2::aes(x=DATE, location=LOCATION_NAME,xmin=xmin,xmax=xmax,size=EQ_PRIMARY,y=COUNTRY), n_max = 5)
It creates an interactive map with popup based on annot_col attribute.
mexico.df <- dplyr::filter(noaa.df, COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) NOAA::eq_map(mexico.df, "DATE")
It creates a label with Location, Magnitude and Total Deaths.
mexico.df<- dplyr::mutate(mexico.df, popup_text = NOAA::eq_create_label(mexico.df)) NOAA::eq_map(mexico.df, "popup_text")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.