geom_timeline_label: Label for NOAA Time line

Description Usage Arguments Aesthetics Examples

Description

This function add labeling the top n earthquakes, by magnitude. Default value is the top 5 earthquakes for each country specified. User can change this value n_max aesthetic.

Usage

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

Arguments

mapping

see ggplot2 layer

data

see ggplot2 layer

stat

see ggplot2 layer

position

see ggplot2 layer

na.rm

see ggplot2 layer

show.legend

see ggplot2 layer

inherit.aes

see ggplot2 layer

...

other arguments.

Aesthetics

geom_timeline_label undertands the following aesthetics (required aesthetics are in bold):

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr); library(lubridate);library(ggplot2)
NOAA_quakes%>%
 eq_clean_data()%>%
 dplyr::filter(COUNTRY %in% c('CHINA','MEXICO')) %>%
 dplyr::filter(DATE > '2010-01-01') %>%
 ggplot2::ggplot() +
 geom_timeline(aes(x = DATE, y = COUNTRY, size = as.numeric(EQ_PRIMARY),
                   color = as.numeric(TOTAL_DEATHS))) +
 guides(size = guide_legend(order=1))+
 scale_color_continuous(name = '# deaths') +
 scale_size_continuous(name = 'Richter scale value') +
 NOAA_thm()

jyjek/jyjekNOAA documentation built on May 7, 2019, 10:52 p.m.