Learn R Programming

RmarineHeatWaves (version 0.17.0)

lolli_plot: Create a Timeline of Selected Event Metrics.

Description

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

Usage

lolli_plot(data, metric = "int_max", event_count = 3,
  xaxis = "date_start")

Arguments

data

Output from the detect function.

metric

One of int_mean, int_max, int_cum and duration. Default is int_cum.

event_count

The number of top events to highlight. Default is 3.

xaxis

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

Value

The function will return a graph of the intensity of the selected metric along the y-axis versus either t or event_no. 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.

Examples

Run this code
# NOT RUN {
ts_dat <- make_whole(sst_NW_Atl)
res <- detect(ts_dat, climatology_start = "1983-01-01",
              climatology_end = "2012-12-31")

# }
# NOT RUN {
lolli_plot(res, metric = "int_cum", event_count = 3, xaxis = "date_peak")
# }

Run the code above in your browser using DataLab