getTransitionTime {discharge}R Documentation

Transition Time

Description

Compute the number of days separating HSAM and LSAM for the given year/years.

Usage

getTransitionTime(index.hsam, index.lsam, years, for.year = NULL)

Arguments

index.hsam

A scalar/vector of index of HSAM values in given year/years

index.lsam

A scalar/vector of index of LSAM values in given year/years

years

A vector of years corresponding to HSAM and LSAM values. This argument can be NULL if the HSAM and LSAM values are scalars.

for.year

(optional) Calculate transition time only for the given year in this argument. If argument is omitted, transition times for all years are calculated.

Value

Scalar transition time if the inputs are scalars, or a Data frame containing two Columns:

year First column, represents year
transition.time Second column, represents transition times

Examples

# load sample data
data("sycamore")
x = sycamore

# get streamflow object for the sample data
x.streamflow = asStreamflow(x)

# prepare baseline signal 
x.bl = prepareBaseline(x.streamflow)

# get HSAM and LSAM values
hsam = getHSAM(x.bl$resid.sig, x.streamflow$data$year)
lsam = getLSAM(x.bl$resid.sig, x.streamflow$data$year)

# transition time
tt = getTransitionTime(hsam$Index.all, lsam$Index.all, hsam$year)


[Package discharge version 1.0.0 Index]