geom_timeline: Timeline of Earthquakes

Description Usage Arguments Details Aesthetics Examples

View source: R/geom_timeline.R

Description

geom_timeline shows a timeline of NOAA Significant earthquakes, plotting individual countries along the y-axis and dates along the x-axis. The size of the points is relatative to the earthquakes' magnitude, and the color is related to the total number of deaths.

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

See ggplot2 layer

data

See ggplot2 layer

stat

See ggplot2 layer

position

See ggplot2 layer

na.rm

See ggplot2 layer

show.legend

See ggplot2 layer

inherit.aes

See ggplot2 layer

...

other arguments passed on to layer.

Details

It is highly recommended that this geom is not used in isolation. For best results, use it with the eq_timeline wrapper function.

Aesthetics

geom_timeline undertands the following aesthetics (required aesthetics are in bold):

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr); library(ggplot2)
quakes <- eq_load_clean_data()

quakes %>%
  dplyr::filter(COUNTRY %in% c('USA', 'UK')) %>%
  dplyr::filter(DATE > '2000-01-01') %>%
  ggplot() +
  geom_timeline(aes(x = DATE, y = COUNTRY, color = TOTAL_DEATHS,
                    size = EQ_PRIMARY)) +
  scale_size_continuous(name = 'Richter scale value') +
  scale_color_continuous(name = '# of Deaths') +
  theme_eq()

DYZI/Earthquake documentation built on May 7, 2019, 6:54 p.m.