Description Usage Arguments Value Examples
Geom for plotting a time line of earthquakes ranging from xmin to xmaxdates with a point for each earthquake. Additionally, this geom adds a vertical line to each data point with a text annotation (e.g. the location of the earthquake) attached to each line.
1 2 3 |
mapping |
Set of aesthetic mappings created |
data |
The data to be displayed |
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 FALSE, overrides the default aesthetics, rather than combining with them. |
... |
Other arguments passed on to the layer. it can be used to set an aesthetic to a fixed value. |
This function returns a timeline plot with annotations
1 2 3 4 5 6 7 8 9 | ## Not run:
df %>% filter(COUNTRY %in% c("RUSSIA", "ISRAEL"), date > "2000-01-01") %>%
ggplot(aes(x = date, size = EQ_PRIMARY, y = COUNTRY, col = DEATHS)) +
geom_timeline() +
scale_size_continuous(name = 'Richter scale value') +
scale_color_continuous(name = '# deaths')+
geom_timeline_label(aes(label=LOCATION_NAME), n_max=1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.