Description Usage Arguments Details Examples
View source: R/geom_timelines.R
geom_timeline
return a layer
representing a time line of earthquakes, i.e. a time line over
which there are a point for each earthquake.
1 2 3 4 5 6 7 8 9 10 |
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?
|
inherit.aes |
If |
... |
further arguments passed to the geom layer |
na.rm |
(lgl, default = FALSE) remove missing data? |
Aesthetics:
geom_timeline
understands the following aesthetics
(required in bold):
x: (Date) of earthquakes
y: (factr) stratification. If present multiple time lines will be plotted for each level of the factor (e.g. country).
colour: of the points
size: of the points
alpha: trasparency for the points
fill
linetype
linesize
fontsize
stroke
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
library(dplyr)
library(lubridate)
library(ggplot2)
library(devrcap)
data(noaa)
noaa %>%
eq_clean_data() %>%
filter(
country %in% c("ITALY", "GREECE", "PORTUGAL"),
year(date) >= 1900
) %>%
ggplot(aes(
x = date,
y = country,
size = eq_primary,
colour = log(total_deaths)
)) +
geom_timeline()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.