ism_get_site_matrix: Create a matrix of data based on ISM

Description Usage Arguments Details Value Examples

Description

ism_get_site_matrix() takes in a matrix of historical data for a single site and applies the Index Sequential Method (ISM) to it. Because this is typically used to create future hydrology data, the entire matrix will have a new start month (starMonth).

Usage

1
2
3
ism_get_site_matrix(xtsData, startMonth, nYrs = NA, monthly = TRUE)

createISMMatrix(xtsData, startMonth, nYrs = NA, monthly = TRUE)

Arguments

xtsData

An xts vector.

startMonth

The start month and year of the return matrix. Should be able to be cast to a zoo::yearmon.

nYrs

The number of years to create the data for. Defaults to the number of years in xtsData, but can be less.

monthly

Boolean that should be set to TRUE if the data are monthly; should set to FALSE if annual data.

Details

The method can be used on monthly or annual data. If you are applying it to monthly data, then xtsData needs to be monthly data, and monthly should be set to TRUE. If using annual data, then xtsData should be annual, i.e., all with a December timestamp, and monthly should be set to FALSE. If monthly is FALSE and xtsData is monthly data, an error will occur.

Value

xts matrix with the number of years/months specified by nYrs and the number of columns equal to the number of years of data in xtsData

Examples

1
2
3
4
5
6
7
# monthly data, that will create a 48x4 xts matrix
t1 <- xts::xts(1:48, zoo::as.yearmon("Jan 2000") + seq(0,47)/12)
ism_get_site_matrix(t1, "Jan 2020")

# annual data that will create a 5 x 6 matrix
t2 <- xts::xts(1:6, zoo::as.yearmon("Dec 2000") + 0:5)
ism_get_site_matrix(t2, "Dec 2020", nYrs = 5, monthly = FALSE)

rabutler/CRSSIO documentation built on May 26, 2019, 8:51 p.m.