geom_timeline: Timeline earthquak graph

Description Usage Arguments Details Examples

Description

Timeline earthquak graph

Usage

1
2
3
geom_timeline(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  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

A timeline plot is a representation of individual earthquaks ordered by their corresponding dates as points; the color of the point represent the number of deaths that resulted from the event and the size represents the magnitude of the event.

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 May 25, 2019, 1:35 p.m.