geom_timeline_label: Timeline label

Description Usage Arguments Details Aesthetics Author(s) Examples

Description

'geom_timeline_label' adds text directly to the timeline plot.

Usage

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

Arguments

n_max

The number of the max size events to display the label.

parse

If TRUE, the labels will be parsed into expressions and displayed as described in ?plotmath

check_overlap

If 'TRUE', text that overlaps previous text in the same layer will not be plotted.

Details

geom_timeline_label() is for adding annotations to the earthquake data. 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. There should be an option to subset to n_max number of earthquakes, where we take the n_max largest (by magnitude) earthquakes. Aesthetics are x, which is the date of the earthquake and label which takes the column name from which annotations will be obtained.

Aesthetics

geom_timeline understand the following aesthetics (required aesthetics are 'x' and 'label'):

x

datetime of the event

label

the text to display

size

the size of the circle drawn at the event

colour

the colour of the circle drawn at the event

y

free groupiong parameter

Author(s)

József Varga

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
eqdta <- eq_location_clean(eq_clean_data(earthquakes)) %>%
filter( date > ymd("20000101") & COUNTRY=="USA") %>%
  head(n=5)

ggplot (data = eqdta,
        aes(
          x = date,
          y = COUNTRY,
          label = LOCATION_NAME,
          size = FOCAL_DEPTH,
          colour = EQ_PRIMARY
        )) +
  geom_timeline() +
  geom_timeline_label(n_max=6)

cogitoergoread/noaa documentation built on May 20, 2019, 1:28 p.m.