geom_timeline_label: geom_timeline_label

Description Usage Arguments Details Examples

Description

Creates additional notation for the timeline chart (see geom_timeline for more details)

Usage

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

Arguments

mapping

Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

stat

The statistical transformation to use on the data for this layer, as a string.

data

a dataframe containing NOAA details

position

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

na.rm

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

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.

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 arguments passed on to layer. These are often aesthetics, used to set an aesthetic to a fixed value, like color = "red" or size = 3. They may also be parameters to the paired geom/stat.

Details

This geom adds a vertical line to each data point with a text annotation (e.g. the location of the earthquake) attached to each line. There is an option to subset to n_max number of earthquakes, where we take the n_max largest (by magnitude) earthquakes.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data %>%
 filter(COUNTRY %in% c("USA", "CHINA")) %>%
 eq_clean_data()%>%
 ggplot(aes(x = DATE, y = COUNTRY, alpha = TOTAL_DEATHS, size = EQ_PRIMARY))+
 geom_timeline()+
 geom_timeline_lable(aes(label = LOCATION_NAME),n_max = 3)

## End(Not run)

fdelzompo/MSDR documentation built on May 3, 2019, 2:58 p.m.