Description Usage Arguments Value Examples
This method returns a layer that contains the timeline geom with labels for earthquake locations. 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 layer containing the timeline geom with labels.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## 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 >= 1900, !is.na(DEATHS), !is.na(EQ_MAG_ML),
COUNTRY %in% c("CHINA", "USA")) %>%
ggplot2::ggplot(ggplot2::aes(x = DATE,
colour = DEATHS,
size = EQ_MAG_ML)) +
geom_timeline() +
geom_timeline_label(ggplot2::aes(label = LOCATION_NAME, n_max = 5)) +
ggplot2::labs(x = "DATE", color = "# deaths", size = "Richter scale value")
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.