geom_timeline: geom_timeline function

Description Usage Arguments Value Examples

View source: R/timeline.R

Description

geom_timeline function

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

The aesthetics that the geom accepts

data

The input dataset

stat

The statistical transformation function that must be used

position

The position of the transformation data

na.rm

A logical scalar. Should missing values (including NaN) be removed?

show.legend

Display the legend or not (TRUE or FALSE)

inherit.aes

Inherit aesthetics from main ggplot call

...

Numeric, complex, or logical vectors.

Value

This function returns a plot where earthquakes are plotted per country and where the size is the magnitude and the colour is the number of deaths

Examples

1
2
3
4
5
6
7
8
## Not run: 
readr::read_delim("earthquakes.tsv.gz",delim = "\t") %>%
eq_clean_data() %>%
 dplyr::filter(COUNTRY == "USA" & lubridate::year(DATE) >= 2000) %>%
 ggplot() +
 geom_timeline(aes(x = DATE, y = COUNTRY,size = EQ_PRIMARY, colour = DEATHS))

## End(Not run)

pvisser82/earthquakedata documentation built on May 19, 2019, 3:05 a.m.