geom_timeline_label: Timeline plots (labels)

Description Usage Arguments Details Examples

Description

geom_timeline_label generates labels for earthquakes on a timeline plot. Used along with geom_timeline.

Usage

1
2
geom_timeline_label(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 parameters

Details

It uses the following additional parameters:

nmax

integer. Top earthquakes with respect to the magnitude. These earthquakes are labelled on the plot.

label

character vector. A column in the NOAA dataset used for labelling the data points.

Examples

1
2
3
4
5
6
7
8
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.