knnst_index_years: Get all the index years from 'knn_st' objects

View source: R/knnst_helpers.R

knnst_index_yearsR Documentation

Get all the index years from knn_st objects

Description

knnst_index_years() gets all of the index years from all of the disaggregation simulations.

Usage

knnst_index_years(disagg)

Arguments

disagg

A knnst object

Value

A matrix where each column is the index years selected for that simulation, i.e., there are knnst_nsim() columns.

Examples

flow_mat <- cbind(c(2000, 2001, 2002), c(1400, 1567, 1325))
# made up historical data to use as index years
ind_flow <- cbind(1901:1980, rnorm(80, mean = 1500, sd = 300))
# make up monthly flow for two sites
mon_flow <- cbind(
  rnorm(80 * 12, mean = 20, sd = 5),
  rnorm(80 * 12, mean = 120, sd = 45)
)
x <- knn_space_time_disagg(
  flow_mat, ind_flow, mon_flow, start_month = 1, scale_sites = 1:2, nsim = 5
)

# will be a 3 x 5 matrix:
knnst_index_years(x)


rabutler-usbr/knnstdisagg documentation built on Sept. 14, 2023, 2:47 p.m.