HypeMultiVar {HYPEtools} | R Documentation |
HypeMultiVar arrays
Description
Constructor function for arrays which hold equidistant time series of multiple HYPE variables for a single sub-basin and multiple model runs, typically imported HYPE basin output results.
Usage
HypeMultiVar(
x,
datetime,
hype.var,
hype.unit,
subid = NULL,
outregid = NULL,
hype.comment = ""
)
Arguments
x |
numeric |
datetime |
|
hype.var , hype.unit |
Character vectors of keywords to specify HYPE variable IDs, corresponding to second dimension
(columns) in |
subid |
Integer, HYPE sub-basin ID. Either this or |
outregid |
Integer, HYPE output region ID, alternative to |
hype.comment |
Character, first-row optional comment string of basin output file. Empty string, if non-existing. |
Details
S3 class constructor function for array objects which can hold (multiple) HYPE basin output results.
Value
Returns a 3-dimensional array with
[time, variable, iteration]
dimensions and additional attributes
:
- datetime
A vector of date-times. Corresponds to 1st array dimension.
- variable
A character vector of HYPE output variable IDs.
- hypeunit
A character vector of HYPE output variable units.
- subid
A single SUBID.
- outregid
A single OUTREGID.
- timestep
A character keyword for the time step.
- comment
A comment string, currently used for class group outputs.
Examples
# import a basin output file
te1 <- ReadBasinOutput(filename = system.file("demo_model",
"results", "0003587.txt", package = "HYPEtools"))
# create a dummy array with two iterations from imported basin file
te2 <- array(data = c(unlist(te1[, -1]), unlist(te1[, -1])),
dim = c(nrow(te1), ncol(te1) - 1, 2),
dimnames = list(rownames(te1), colnames(te1)[-1]))
# Construct HypeMultiVar array
HypeMultiVar(te2, datetime = te1$DATE, hype.var = variable(te1),
hype.unit = hypeunit(te1), subid = 3587)