geom_timeline: Make a time line geom

Description Usage Arguments Details Value Examples

Description

geom_timeline() makes a ggplot2::Geom with timeline and special marks for an earthquakes, occured in the defined by user date interval. User must specify the following parameters: begin date; end date; column in data with earthquakes date to use; column in data with earthquakes magnitude to use, column in data with earthquakes deaths to use.

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

ggplot parameter

data

Earthquake data in the dataframe in format of NOAA earthquakes database (Dataframe), mandatory.

stat

ggplot parameter

position

ggplot parameter

na.rm

ggplot parameter

show.legend

ggplot parameter

inherit.aes

ggplot parameter

...

other ggplot parameter

The folloing parameters must be passed as parameters of aesthetic:

xmindate Minimal date of the considering time frame (Date), mandatory. xmaxdate Maximum date of the considering time frame (Date), mandatory. event_date Date of earthquake, usually name of the column in data (Date), mandatory. richter Richter's magnitude of earthquakes, usually name of the column in data (numeric), mandatory. death Deaths produced by earthquakes, usually name of the column in data (numeric), mandatory. colour Main colour of earthquakes marks (colour name), optional scale Scale of earthquakes marks, coefficient (numeric), optional transparency Transparency of earthquakes marks (numeric, (0..1)), optional layers Groping of earthquakes marks by some parameters, e.g. COUNTRY, optional

Details

See other parameters below.

Value

timeline geom (ggplot2 object)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ggplot2::ggplot() +
  theme_void() +
  geom_timeline(data = earthquakes, aes(event_date = DATE,
                                  xmindate = 2000,
                                  xmaxdate = 2010,
                                  richter = EQ_PRIMARY,
                                  death = DEATHS,
                                  transparency = 0.3,
                                  colour = "red",
                                  scale = 0.5,
                                  layers = COUNTRY))+
  theme(legend.position="none")

flyeye/earthquakes documentation built on May 16, 2019, 1:42 p.m.