Description Usage Arguments Value Examples
This method creates the required layer containing the timeline geom for earthquake data on. The color aesthetic shows the number of deaths. The size aesthetic shows the Richter scale of the earthquakes.
1 2 3 |
mapping |
Set of aesthetic mappings created by aes or aes_. |
data |
The data to be displayed in this layer, data.frame |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment as a string or function. |
na.rm |
either TRUE or FALSe for for removing missing values with or without warning. |
show.legend |
TRUE or FALSE to show the legend or notlogical. |
inherit.aes |
TRUE or FALSE for inheriting aies |
... |
Additional parameters |
A ggplot2 layer containing the timeline geom for earthquake data.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
f <- system.file("extdata", "signif.txt", package="earthquakes")
p <- readr::read_delim(file = f, delim = "\t") %>%
eq_clean_data() %>% eq_location_clean() %>%
dplyr::filter(YEAR >= 2000, COUNTRY %in% "USA") %>%
ggplot2::ggplot() +
geom_timeline(ggplot2::aes(x = DATE, colour = DEATHS,
size = EQ_MAG_ML)) +
ggplot2::labs(x = "DATE", color = "Deaths", size = "Richter scale")
gt <- ggplot2::ggplot_gtable(ggplot2::ggplot_build(p))
grid::grid.draw(gt)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.