Description Usage Arguments Value Aesthetics Examples
A ggplot2 graphical function to plot a timeline of earthquakes from cleaned data. The plot indicates the magnitude of each earthquake and number of deaths.
1 2 3 4 5 6 7 8 9 10 |
mapping |
mapping |
data |
data |
stat |
stat |
position |
position |
na.rm |
na.rm |
show.legend |
show.legend |
inherit.aes |
inherit.aes |
... |
... |
ggplot2 graphical object
geom_timeline
understands the following aesthetics:
x
date
y
latitude
xmin
minimum date for earthquakes
xmax
maximum date for earthquakes
size
used to size shape based on magnitude of earthquake eg EQ_PRIMARY
fill
used to colour shape based on number of deaths eg DEATHS
colour
used to colour shape based on number of deaths eg DEATHS
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(dplyr)
library(ggplot2)
library(lubridate)
eq_clean_data(eq_data_raw) %>% eq_location_clean() %>%
dplyr::filter(COUNTRY %in% c("USA","IRAN")) %>%
ggplot2::ggplot() +
geom_timeline(aes(x = date,
y = COUNTRY,
colour = DEATHS,
size = EQ_PRIMARY,
fill = DEATHS,
xmin = lubridate::ymd_hm("2000-01-01",truncated = 2),
xmax = lubridate::ymd_hm("2016-01-01",truncated = 2)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.