Description Usage Arguments Format Details Value Examples
View source: R/geom-timeline.R
Timeline geom for earthquake data
1 2 3 4 5 6 |
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. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
xmin |
Minimum date to represent |
xmax |
Maximum date to represent |
... |
other arguments passed on to |
An object of class GeomTimeline
(inherits from Geom
, ggproto
) of length 8.
This geom is for plotting a time line of earthquakes ranging from xmin to xmax dates with a point for each earthquake. Optional aesthetics include color, size, and alpha (for transparency).
some stratification in which case multiple time lines will be plotted for each level of the factor (e.g. country).
Returns the geom for ggplot2 graphics
1 2 3 4 5 | library(ggplot2)
library(lubridate)
clean <- eq_clean_data(earthquake_data_raw)
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.