getTransitionTime: Transition Time

Description Usage Arguments Value Examples

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)

discharge documentation built on May 2, 2019, 5:54 a.m.