geom_timeline_label: Label the earthquakes on the timeline

Description Usage Arguments Examples

View source: R/module2.R

Description

geom_timeline_label labels the n biggest earthquakes (based on the Richter scale)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
geom_timeline_label(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  show.legend = NA,
  na.rm = FALSE,
  inherit.aes = TRUE,
  ...
)

Arguments

mapping

Set of aesthetics mappings created by ggplot2 aes

data

The data to be displayed in this layer

stat

not working (no stat functionality)

position

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

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

na.rm

If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed

inherit.aes

If FALSE, overrides the default aesthetics, rather than combining with them

...

Other arguments to layer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
dataset %>% filter(Country %in% c("MEXICO", "IRAN") &
     Date %within% lubridate::interval(ymd(20000103), ymd(20180104))) %>%
     mutate(Country = factor(Country, levels = unique(Country))) %>%
     ggplot() +
     geom_timeline(ggplot2::aes(x = Date, y = Country, size = Mag, colour = Deaths)) +
     geom_timeline_label(aes(x = Date, y = Country, label = Location,
                         magnitude = Mag, colour = Deaths, n_max = 7), alpha = 0.5) +
     scale_colour_continuous(name = "Nb. of deaths") +
     theme(legend.position = "bottom") +
     ylab("")

## End(Not run)

BFavetto/EarthquakeAnalysis documentation built on Dec. 17, 2021, 9:50 a.m.