Description Usage Arguments Details Aesthetics Examples
View source: R/geom_timeline.R
geom_timeline
shows a timeline of NOAA Significant earthquakes,
plotting individual countries along the y-axis and dates along the x-axis.
The size of the points is relatative to the earthquakes' magnitude, and
the color is related to the total number of deaths.
1 2 3 |
mapping |
See |
data |
See |
stat |
See |
position |
See |
na.rm |
See |
show.legend |
See |
inherit.aes |
See |
... |
other arguments passed on to |
It is highly recommended that this geom is not used in isolation. For
best results, use it with the eq_timeline
wrapper function.
geom_timeline
undertands the following aesthetics (required
aesthetics are in bold):
x: recommend DATE
y: recommend COUNTRY
size: recommend EQ_PRIMARY
color: recommend TOTAL_DEATHS
alpha
shape
stroke
fill
1 2 3 4 5 6 7 8 9 10 11 12 | library(dplyr); library(ggplot2)
quakes <- eq_load_clean_data()
quakes %>%
dplyr::filter(COUNTRY %in% c('USA', 'UK')) %>%
dplyr::filter(DATE > '2000-01-01') %>%
ggplot() +
geom_timeline(aes(x = DATE, y = COUNTRY, color = TOTAL_DEATHS,
size = EQ_PRIMARY)) +
scale_size_continuous(name = 'Richter scale value') +
scale_color_continuous(name = '# of Deaths') +
theme_eq()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.