Description Usage Arguments Details See Also Examples
View source: R/geom_timeline.R
Adds an earthquake timeline geom to a ggplot2 object expecting noaa dataset cleaned with eq_clean_data
.
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. |
na.rm |
If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed to ggplot2::layer |
### Aesthetics geom_timeline uses the following aesthetics (bold is required):
xDATE
yGrouping variable by which visualization is split (usually COUNTRY)
colourColour of earthquake marker (e.g. TOTAL_DEATHS)
sizeSize of earthquake marker (e.g. MAG, EQ_PRIMARY)
1 2 3 4 5 6 7 8 9 | ## Not run:
system.file("extdata", "noaa_earthquakes.tsv", package = "noaa") %>%
eq_read_data %>%
eq_clean_data %>%
filter(COUNTRY %in% c("USA", "CHINA") & YEAR > 2000) %>%
ggplot(aes(x = DATE, y = COUNTRY, color = TOTAL_DEATHS, size = MAG)) +
geom_timeline()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.