geom_timeline_label: Timeline label

Description Usage Arguments Details Examples

View source: R/timeline.R

Description

Timeline label

Usage

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

Arguments

mapping

Set of aethetics created by aes.

data

A data.fram such as that obtained from NOAA

stat

A string of statistical transfromation.

position

Position adjustment.

na.rm

A logical for dealing with missing values.

show.legend

A logical for showing legend or not.

inherit.aes

A logical of whether or not override default aesthetics.

...

Other arguments passed to layer.

Details

Adds labels for the locations of individual earthquaks. Used with geom_timeline.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# load and clean data
file_path <- system.file("extdata", "signif.tsv", package = "MSDR")
signif <- read_tsv(file_path) %>%
  eq_clean_date %>%
  eq_clean_location

# make graph
signif %>%
filter(COUNTRY == 'MEXICO') %>%
  ggplot(aes(date = date,
             xmin = as.Date('1995-01-01'),
             xmax = as.Date('2000-12-30'),
             y = COUNTRY,
             colour = DEATHS,
             fill = DEATHS,
             size = EQ_PRIMARY,
             location = LOCATION)) +
  geom_timeline() +
  geom_timeline_label() +
  theme(axis.line.y = element_blank(),
        axis.line.x = element_line(),
        axis.ticks.y = element_blank(),
        axis.text.y = element_blank(),
        axis.title.y = element_blank(),
        legend.position = 'bottom',
        panel.grid = element_blank(),
        panel.background = element_blank())

## End(Not run)

TRSperzel/R-Capstone-Project documentation built on Nov. 9, 2019, 12:51 p.m.