limbs: Extract rising/falling limbs

View source: R/limbs.R

limbsR Documentation

Extract rising/falling limbs

Description

Identify the rising and falling limbs within each event (and optionally plot)

Usage

limbs(
  data,
  dates = NULL,
  events,
  to.plot = TRUE,
  ymin = min(data),
  ymax = max(data),
  xlab = "",
  ylab = "",
  main = ""
)

Arguments

data

The data vector (e.g. a streamflow time series)

dates

Date variable, default to NULL (inputting data as a simple vector)

events

Event extracted

to.plot

c(TRUE,FALSE) whether a plot is produced for the limbs

ymin

Minimum plot extend in vertical direction

ymax

Maximum plot extent in vertical direction

xlab

x-axis label

ylab

y-axis label

main

Plot title

Value

Returns indices of start and end of events and the rising/falling limbs within each event

Examples

# Example 1
library(hydroEvents)
qdata = WQ_Q$qdata[[1]]
BF_res = eventBaseflow(qdata$Q_cumecs)
limbs(data = qdata$Q_cumecs, dates = NULL, events = BF_res, main = "with 'eventBaseflow'")
BFI_res = eventBaseflow(dataBassRiver)

# Example 2
library(hydroEvents)
BFI_res = eventBaseflow(dataBassRiver)
d = as.Date("1974-06-30") + 0:(length(dataBassRiver)-1)
limbs(data = dataBassRiver, dates = NULL, events = BFI_res)
limbs(data = dataBassRiver, dates = d, events = BFI_res)

hydroEvents documentation built on Dec. 28, 2022, 3:06 a.m.