geom_timeline_label: Geom for plotting a time line of earthquakes with annotations

Description Usage Arguments Value Examples

Description

This function plots a time line of earthquakes from data U.S. National Oceanographic and Atmospheric Administration (NOAA) database. This geom adds a vertical line to each data point with a text annotation (e.g. the location of the earthquake) attached to each line.

Usage

1
geom_timeline_label(data, xmindate, xmaxdate, country = c("USA"), n_max)

Arguments

data

A preproccessed tibble (data.frame) of NOAA earthquakes dataset

xmindate

a character vector indicating the mininum date specified for earthquakes time line plotting. Should follow the format of YYYY-MM-DD.

xmaxdate

a character vector indicating the maximum date specified for earthquakes time line plotting. Should follow the format of YYYY-MM-DD.

country

a vector of character strings for the countries of interest. By default it shows earthquake data related to USA.

n_max

a numeric value for maximum number of earthquakes to be cosidered for location annotations

Value

This function returns a ggplot

Examples

1
2
NOAA_clean_data = eq_clean_data("https://www.ngdc.noaa.gov/nndc/struts/results?type_0=Exact&query_0=$ID&t=101650&s=13&d=189&dfn=signif.txt")
geom_timeline_label(NOAA_clean_data, xmindate = "1999-01-01", xmaxdate = "2017-12-31", country = c("CHINA", "USA"), n_max = 7.2)

androsova/NOAA documentation built on May 10, 2019, 11:44 a.m.