geom_timeline_label: Plot a timeline of earthquake with annotations

Description Usage Arguments Value Examples

Description

Geom for plotting a time line of earthquakes ranging from xmin to xmaxdates with a point for each earthquake. Additionally, this geom adds a vertical line to each data point with a text annotation (e.g. the location of the earthquake) attached to each line.

Usage

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

Arguments

mapping

Set of aesthetic mappings created

data

The data to be displayed

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.

show.legend

logical. Should this layer be included in the legends?

na.rm

If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed.

inherit.aes

If FALSE, overrides the default aesthetics, rather than combining with them.

...

Other arguments passed on to the layer. it can be used to set an aesthetic to a fixed value.

Value

This function returns a timeline plot with annotations

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
df %>% filter(COUNTRY %in% c("RUSSIA", "ISRAEL"), date > "2000-01-01") %>%
 ggplot(aes(x = date, size = EQ_PRIMARY, y = COUNTRY, col = DEATHS)) +
 geom_timeline() +
 scale_size_continuous(name = 'Richter scale value') +
 scale_color_continuous(name = '# deaths')+
 geom_timeline_label(aes(label=LOCATION_NAME), n_max=1)
 
## End(Not run)

Liddlle/capstone documentation built on June 5, 2019, 8:49 p.m.