geom_timeline: Create a timeline plot of earthquakes

Description Usage Arguments Value Examples

Description

This function creates a plot showing earthquakes by date and country. It uses the GeomTimeline geom. The arguments are similar to those use in ggplot2 functions such as geom_point().

Usage

1
2
3
geom_timeline(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

Arguments

mapping

An aesthetic mapping created by ggplot2::aes.

data

A data frame containing the data to be plotted.

stat

A string indicating the data transformation to be used.

position

A string giving the poistion adjustment.

na.rm

A logical controlling how missing values are handled. If FALSE, missing values are removed and a warning is printed, otherwise missing values are removed without a warning.

show.legend

A logical indicating whether the layer created by this function should have a legend.

inherit.aes

A logical. If FALSE, the default aesthetics are overridden.

...

additional arguments passed to the layer.

Value

This function adds an earthquake timeline plot to the current ggplot.

Examples

1
2
3
4
5
6
eq_data <- eq_clean_data("NOAA_earthquakes.txt")
eq_data <- subset(eq_data, Country == "Mexico" & YEAR >= 2000)

ggplot2::ggplot(eq_data) +
  geom_timeline(ggplot2::aes(x=DATE, y=Country, fill=TOTAL_DEATHS, 
                 size=EQ_PRIMARY))

lmitchell4/earthquake documentation built on May 29, 2019, 3:42 a.m.