geom_timeline: geom_timeline

Description Usage Arguments Value Aesthetics Examples

View source: R/earthquake.R

Description

A ggplot2 graphical function to plot a timeline of earthquakes from cleaned data. The plot indicates the magnitude of each earthquake and number of deaths.

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

mapping

data

data

stat

stat

position

position

na.rm

na.rm

show.legend

show.legend

inherit.aes

inherit.aes

...

...

Value

ggplot2 graphical object

Aesthetics

geom_timeline understands the following aesthetics:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(dplyr)
library(ggplot2)
library(lubridate)
eq_clean_data(eq_data_raw) %>% eq_location_clean() %>%
dplyr::filter(COUNTRY %in% c("USA","IRAN"))  %>%
    ggplot2::ggplot() +
    geom_timeline(aes(x = date,
                      y = COUNTRY,
                      colour = DEATHS,
                      size = EQ_PRIMARY,
                      fill = DEATHS,
                      xmin = lubridate::ymd_hm("2000-01-01",truncated = 2),
                      xmax = lubridate::ymd_hm("2016-01-01",truncated = 2)))

Moonglum8/rEarthquake documentation built on July 17, 2020, 5:10 p.m.