geom_timeline: Timeline plots

Description Usage Arguments Details Examples

Description

geom_timeline is used to visualize earthquake occurence, intensity, the number of deaths caused, and other parameters.

Usage

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

Arguments

mapping

mapping

data

data

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

na.rm

remove NAs

show.legend

logical. Should this layer be included in the legends? 'NA', the default, includes if any aesthetics are mapped. 'FALSE' never includes, and 'TRUE' always includes. It can also be a named logical vector to finely select the aesthetics to display.

inherit.aes

If 'FALSE', overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. [borders()].

...

other parameter

Details

It uses the following additional parameters:

xmin

a date. The lower bound of the date interval used for subsetting the NOAA data.

xma

a date. The upper bound of the date interval used for subsetting the NOAA data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data("eq_data")
ggplot() +
geom_timeline(data = eq_data %>% filter(COUNTRY == "ITALY"),
       aes(x = DATE, size = EQ_PRIMARY, color = TOTAL_DEATHS,
           xmin = as.Date('1950-01-01'),
           xmax = as.Date('2015-01-01'))) +
 theme_eq



data("eq_data")
ggplot(data = eq_data %>% filter(COUNTRY %in% c('COLOMBIA', 'MEXICO', 'USA')),
       aes(x = DATE, y = COUNTRY, size = EQ_PRIMARY,
           color = TOTAL_DEATHS, xmin = as.Date('1970-01-01'),
           xmax = as.Date('2015-01-01'))) +
  geom_timeline_label(aes(label = as.character(DATE)), nmax = 2) +
  geom_timeline() +
  theme_eq

slava-kohut/R-Capstone-SoftDev documentation built on May 20, 2019, 10 a.m.