lolli_plot: Create a timeline of selected event metrics as 'lollipops'.

Description Usage Arguments Value Author(s) Examples

View source: R/graph_functions.R

Description

Visualise a timeline of several possible event metrics as 'lollipop' graphs.

Usage

1
2
3
4
5
6
lolli_plot(
  data,
  xaxis = "date_peak",
  metric = "intensity_max",
  event_count = 3
)

Arguments

data

Output from the detect_event function.

xaxis

One of event_no, date_start or date_peak. Default is date_start.

metric

One of intensity_mean, intensity_max, intensity_cumulative and duration. Default is intensity_max.

event_count

The number of top events to highlight, as determined by the value given to metric. Default is 3.

Value

The function will return a graph of the intensity of the selected metric along the y-axis and the chosen xaxis value. The number of top events as per event_count will be highlighted in a brighter colour. This function differs in use from geom_lolli in that it creates a stand-alone figure. The benefit of this being that one must not have any prior knowledge of ggplot2 to create the figure.

Author(s)

Albertus J. Smit and Robert W. Schlegel

Examples

1
2
3
4
5
6
7
ts <- ts2clm(sst_WA, climatologyPeriod = c("1983-01-01", "2012-12-31"))
res <- detect_event(ts)

library(ggplot2)

# The default output
lolli_plot(res)

heatwaveR documentation built on Oct. 27, 2021, 5:08 p.m.