geom_timeline: Timeline

Description Usage Arguments Aesthetics Author(s) Examples

Description

The timeline geom is used to create discrete point plots over a timeline. Time line of events ranging from xmin to xmax dates with a point for each event. Optional aesthetics include color, size, and alpha (for transparency). The xaesthetic is a date and an optional y aesthetic is a factor indicating some stratification in which case multiple time lines will be plotted.

Usage

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

Arguments

...

other arguments passed on to [layer()]. These are often aesthetics, used to set an aesthetic to a fixed value, like 'color = "red"' or 'size = 3'. They may also be parameters to the paired geom/stat.

na.rm

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

Aesthetics

geom_timeline understand the following aesthetics (required aesthetics is 'x'):

x

datetime of the event

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
15
16
17
18
## Not run: 
  # Use the built-in NOAA dataset filtered for two countries
  eqdta <- eq_location_clean(eq_clean_data(earthquakes)) %>%
  filter( date > ymd("20000101") & (COUNTRY=="USA" | COUNTRY=='CHINA' ) ) %>%
    group_by(COUNTRY)

  # Draw the geom
  ggplot (data = eqdta) +
    geom_timeline(
      aes(
        x = date,
        y = COUNTRY,
        size = FOCAL_DEPTH,
        colour = EQ_PRIMARY
      )
    )

## End(Not run)

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