resize_input.wateres: Reservoir input time series resize

View source: R/wateres.R

resize_inputR Documentation

Reservoir input time series resize

Description

Resizes input time series of the reservoirs. Both shortening and expanding are supported. In case of expanding, input variables for the new time steps are set to zero while dates and number of minutes are correctly filled in.

Usage

resize_input(reser, begin, end, type)

## S3 method for class 'wateres'
resize_input(reser, begin = 1, end = nrow(reser),
  type = NULL)

Arguments

reser

A wateres object.

begin

New time series begin entered as a value that can be converted to date or as a number representing index within the time series (can be less than 1 for expanding before the current series). Dates cannot be used if the wateres object does not contain dates (e.g. for hourly data).

end

New time series end entered the same way as begin. The end value cannot be less than the begin value.

type

Optional type of begin and end (one of “index” or “date”) to speed up the resize.

Value

A wateres object with the resized series.

Examples

reser = data.frame(
    Q = c(0.078, 0.065, 0.168, 0.711, 0.154, 0.107, 0.068, 0.057, 0.07, 0.485, 0.252, 0.236,
          0.498, 0.248, 0.547, 0.197, 0.283, 0.191, 0.104, 0.067, 0.046, 0.161, 0.16, 0.094),
    DTM = seq(as.Date("2000-01-01"), by = "months", length.out = 24))
reser = as.wateres(reser, storage = 4e5, area = 754e3)
reser = resize_input(reser, "2000-02-15", 20)

tgmwri/wateres documentation built on Feb. 13, 2024, 10:25 p.m.