geom_timeline: Plot a timeline of earthquakes

Description Usage Arguments Value Examples

View source: R/geom_timeline.R

Description

This function plots a timeline of earthquakes

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
geom_timeline(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

mapping

Set of aethetics created by aes

data

A filtered data frame

stat

A string of statistical transformation

position

A string of position adjustment

na.rm

logical; if FALSE (default) NA values are not removed

show.legend

logical; for showing a legend

inherit.aes

logical; if TRUE (default) default aesthetics are overridden

...

Other arguments including x for the column name for DATE, xmin for the beginning date and xmax for the end date of the timeline

Value

geom_timeline returns a layer for plotting the GeomTimeline object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
Countries <- c('USA', 'CHINA')
XMin <- ymd('2000-01-01')
XMax <- ymd('2020-01-01')
readr::read_delim(system.file("extdata", "signif.txt", package = "TheCapstoneProject"), delim = '\t') %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY %in% Countries) %>%
ggplot2::ggplot() +
geom_timeline(aes(x = DATE, xmin = XMin, xmax = XMax, y = COUNTRY, size = EQ_PRIMARY, color = TOTAL_DEATHS)) +
labs(x = 'DATE', y = 'COUNTRY', color = '# deaths', size = 'Richter scale value') +
lims(x = c(XMin, XMax))

## End(Not run)

ekawabata/TheCapstoneProject documentation built on June 27, 2020, 7:58 a.m.