geom_timeline_label: geom_timeline_label function

Description Usage Arguments Value Examples

View source: R/timeline.R

Description

geom_timeline_label function

Usage

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

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

n_max

The maximum number of labels to display

Value

This function returns the labels that are plotted on the timeline

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)) +
 geom_timeline_label(aes(x = DATE, y = COUNTRY, label = LOCATION_NAME,
 size = EQ_PRIMARY), n_max = 5) +
 ggtitle("Earthquake Timeline") +
 theme_timeline() +
 labs(size = "Richter Scale value:", colour = "# of Deaths:")

## End(Not run)

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