Description Usage Arguments Format Details Value Examples
View source: R/geom_timeline.R
Timeline geom for earthquake data from NOAA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
show.legend |
logical. Should this layer be included in the legends?
|
na.rm |
If |
inherit.aes |
If |
xmin |
Minimum date to represent. Must be in a Date class object |
xmax |
Maximum date to represent. Must be in a Date class object |
... |
Other arguments passed on to |
An object of class GeomTimeline
(inherits from Geom
, ggproto
, gg
) of length 8.
This geom plots earthquakes on a timeline ranging from a minimum (xmin) to a maximum (xmax). Each point is an earthquake.
The x aesthetic is a Date class vector of dates of earthquakes.
Size, colour, alpha and y can be provided as optional aesthetic. y must be a factor.
Returns the geom for ggplot2 graphics
1 2 3 4 5 | library(ggplot2)
library(lubridate)
clean <- eq_clean_data(raw_noaa)
ggplot(clean, aes(x = DATE, y = COUNTRY, size=EQ_PRIMARY, fill = DEATHS)) +
geom_timeline(alpha = 0.25, xmin = ymd('2000-01-01'), xmax = ymd('2015-12-31'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.