Description Usage Arguments Details Value Note Examples
The geom_timeline visualises earthquakes events over time and per country in magnitude and number of deaths.
1 2 3 |
mapping |
Set of aesthetic mappings created by |
data |
- File name |
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 |
... |
other arguments passed on to |
x |
- The parameter in the X-axis: the time (as.Date object) |
y |
- The parameter in the Y-axis: the country names (character) |
size |
- The parameter that represents the magnitude of the earthquake, indicating the size of the circles (=earthquake event): Richter scale value (numeric) |
fill |
- The parameter that represents the deaths resulted from the earthquake, colouring the circles (=earthquake event) |
The geom_timeline function works together with ggplot2. This function visualises the earthquakes events over time (x aesthetics) and per country (y aesthetics) in magnitude (size parameter) and number of deaths (fill parameter.
A geom layer with timeline, each timeline shows a country with its earthquake events in circles, the magnitude of an earthquake (size of circles) and the number of deaths (the colouring of the circles).
error - An error will appear when a parameter is not given.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
ggplot() +
geom_timeline(eq_clean_data(file) %>%
filter(COUNTRY == c("China", "Usa", "Japan"),
DATE >= "1999-01-01",
DATE <= "2012-12-31"),
aes(x = DATE, y = COUNTRY, size = richterScaleValue, fill = DEATHS)) +
theme(legend.position = "bottom")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.