Learn R Programming

RmarineHeatWaves (version 0.14.1)

event_line: Create a Line Plot of Marine Heat Waves or Cold Spells.

Description

Creates a graph of warm or cold events as per the second row of Figure 3 in Hobday et al. (2016).

Usage

event_line(data, spread = 150, metric = "int_cum", start_date = "1999-06-30", end_date = "2000-05-30")

Arguments

data
The function receives the output from the detect function.
spread
The the number of days leading and trailing the largest event (as per metric) detected within the time period specified by start_date and end_date. The default is 150 days.
metric
One of the following options: int_mean, int_max, int_var, int_cum, int_mean_rel_thresh, int_max_rel_thresh, int_var_rel_thresh, int_cum_rel_thresh, int_mean_abs, int_max_abs, int_var_abs, int_cum_abs, int_mean_norm, int_max_norm, rate_onset, rate_decline. Partial name matching is currently not supported so please specify the metric name precisely. The default is int_cum.
start_date
The start date of a period of time within which the largest event (as per metric) is retrieved and plotted. This may not necessarily correspond to the biggest event of the specified metric within the entire data set. To plot the biggest event within the whole time series, make sure start_date and end_date straddle this event, or simply specify the start and end dates of the full time series given to detect.
end_date
The end date of a period of time within which the largest event (as per metric) is retrieved and plotted. See start_date for additional information.

Value

The function will return a line plot indicating the climatology, threshold and temperature, with the hot or cold events that meet the specifications of Hobday et al. (2016) shaded in as appropriate. The plotting of hot or cold events depends on which option is specified in detect. The top event detect during the selected time period will be visible in a brighter colour.

References

Hobday, A.J. et al. (2016), A hierarchical approach to defining marine heatwaves, Progress in Oceanography, 141, pp. 227-238, doi: 10.1016/j.pocean.2015.12.014

Examples

Run this code
t_dat <- make_whole(sst_WA)
res <- detect(t_dat, climatology_start = 1983, climatology_end = 2012) # using default values

## Not run: 
# event_line(res, spread = 200, metric = "int_cum",
# start_date = "2010-10-01", end_date = "2011-08-30")
# ## End(Not run)

Run the code above in your browser using DataLab