geom_timeline_label: Plot Timeline (Label)

Description Usage Arguments Value Examples

Description

This function draws the labels for the data points of the top n disastrous earthquakes in order of MAGNITUDE.

Usage

1
2
3
4
geom_timeline_label(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, n_max = 5,
  xmin = lubridate::dmy("01/01/2010"), xmax = lubridate::dmy("01/01/2016"),
  ctry = "JAPAN", show.legend = NA, inherit.aes = TRUE, ...)

Arguments

mapping

A set of aesthetic mappings created by aes()

data

A dataframe object containing the earthquake data points from the eq_location_clean function that is to be displayed in this layer of the plot

stat

A string representing the statistical transformation for this layer of the plot

position

A string representing the positional adjustment

na.rm

A logical value to indicate whether to raise warning when missing values are removed for the plot

n_max

An integer representing the maximum number of data labels to draw based on the magnitude of the earthquakes

xmin

An integer representing the minimum date value using the lubridate::dmy("dd/mm/yyyy") function, inclusive

xmax

An integer representing the maximum date value using the lubridate::dmy("dd/mm/yyyy") function, exclusive

ctry

A string representing the country filter for the plot

show.legend

A logical value to indicate whether this layer of the plot should be included in the legends

inherit.aes

A logical value to indicate whether to override the default aesthetics or to combine with them

...

A list representing other aesthetics to be passed on to this layer of the plot

Value

This function returns a timeline label of earthquakes for the selected country for the selected time frame

Examples

1
2
3
4
5
6
7
8
## Not run: ggplot(data = y, aes(x = DATE, country = COUNTRY, label = LOCATION, 
                     magnitude = MAGNITUDE)) + 
  geom_timeline(ctry = "USA", xmin = dmy("01/01/2010"), xmax = dmy("01/01/2016")) + 
  geom_timeline_label(n_max = 5, ctry = "USA", 
                      xmin = dmy("01/01/2010"), 
                      xmax = dmy("01/01/2016")) + 
  theme_classic()
## End(Not run)

elyminator91/MasteringSoftwareDevelopmentCapstone documentation built on May 20, 2019, 9:59 a.m.