recession_events_index: Extract recession events from a streamflow time series

Description Usage Arguments Value

View source: R/recessions_analysis.R

Description

This function extracts the index of the start and end of each recession event which are returned in a two columns data.frame

Usage

1
2
3
4
5
6
7
8
9
recession_events_index(
  Q,
  minduration,
  maxduration,
  minvalue,
  n_smooth,
  window_smooth,
  return_smoothed = FALSE
)

Arguments

Q

numeric vector. Streamflow vector.

minduration

integer. Minimum duration of a recession event in days

maxduration

integer. Maximum duration of a recession event in days

minvalue

float. Minimum streamflow value to consider a local maximum as a potential start of a recession event

n_smooth

integer. How many times the rolling mean is to be applied on the streamflow timeseries before applying the recession events extraction

window_smooth

integer. The size, in days, of the window over which the rollogin mean is to be applied.

return_smoothed

logical. Whether the smoothed streamflow timeseries should be returned as well.

Value

Returns a two columns data.frame with the 'start' and 'end' index of each recession event. If 'return_smoothed' is TRUE, a list with two elements is returned: 'i_events' containing the the data.frame with the 'start' and 'end' index of the recession events and 'Q_smoothed' containing the smoothed streamflow vector.


IvanHeriver/hsa-R-package documentation built on Dec. 17, 2021, 11:32 p.m.