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.
Returns
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 datadata("sycamore")x = sycamore
# get streamflow object for the sample datax.streamflow = asStreamflow(x)# prepare baseline signal x.bl = prepareBaseline(x.streamflow)# get HSAM and LSAM valueshsam = getHSAM(x.bl$resid.sig, x.streamflow$data$year)lsam = getLSAM(x.bl$resid.sig, x.streamflow$data$year)# transition timett = getTransitionTime(hsam$Index.all, lsam$Index.all, hsam$year)