geom_timeline_label: Create Timeline Lablels

Description Usage Arguments Details Value Examples

View source: R/geom_timeline_label.R

Description

This function creates a new geom that can build on geom_timeline and add labels to the top n biggest earthqakes by magnitude

Usage

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

Arguments

mapping

defaults to NULL

data

defaults to NULL, unless data passed in

stat

defautls to 'identity'

position

defautls to 'identity'

na.rm

defaults to FALSE, do not remove NAs

show.legend

defaults to NA

inherit.aes

defaults to TRUE

...

takes additional arguments

Details

Create a new geom called geom_timeline_label that is used to plot relevant top_n labels on geom_timeline

Value

Returns a ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: data %>%
    ggplot() +
    geom_timeline(aes(
        x = DATE,
        y = COUNTRY,
        fill = TOTAL_DEATHS,
        size = EQ_PRIMARY)) +
    geom_timeline_label(aes(
        x = DATE,
        y = COUNTRY,
        magnitude = EQ_PRIMARY,
        label = LOCATION_NAME
        ,n_max=3 #number of lables to show))

## End(Not run)

ctaber/NOAA documentation built on Nov. 4, 2019, 9:19 a.m.