geom_timeline: This method creates the required layer containing the...

Description Usage Arguments Value Examples

Description

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.

Usage

1
2
3
geom_timeline(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

Arguments

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

Value

A ggplot2 layer containing the timeline geom for earthquake data.

Examples

 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)

bernd-mueller/earthquakes documentation built on May 7, 2019, 8 a.m.