GeomTimeline: ggplot geom to plot a time line of earthquakes

Description Usage Arguments Format Value Examples

Description

This function reads an Earthquake dataset in a dataframe format to plot a time line of earthquakes ranging from the minimum to the maximum dates with a point for each earthquake. The x aesthetic is a date and an optional y aesthetic is a factor that stratifies the data by country, in which case multiple time lines will be plotted, one for each country. In addition to showing the dates on which the earthquakes occur, it is also possible to show the magnitudes (i.e. Richter scale value) and the number of deaths associated with each earthquake.

Usage

1

Arguments

x

A character vector of the dates when the earthquakes took place.

y

Optional aesthetic which contains a character vector of the country names, wherein the earthquakes took place.

fill

Optional aesthetic which contains a numeric vector of the number of deaths in each earthquake, which will define the colour of the points to be plotted.

size

Optional aesthetic which contains a numeric vector of the magnitude (in the Richter scale) of each earthquake, which will define the size of the points to be plotted.

alpha

Optional aesthetic that represents a number between 0 and 1, which indicates the level of transparency of represented points.

Format

An object of class GeomTimeline (inherits from Geom, ggproto) of length 5.

Value

An earthquakes' timeline geom object which can be added to a ggplot.

Examples

1
2
3
4
5
## Not run: 
quakedata<-eq_clean_data("signif.txt")
ggplot() + geom_timeline(data = quakedata,aes(x = DATETIME, y = COUNTRY, size = EQ_PRIMARY, fill = TOTAL_DEATHS)) + scale_color_gradient()

## End(Not run)

DanielAyllon/EarthQuakeAnalyzer documentation built on May 6, 2019, 1:23 p.m.