View source: R/class_HypeMultiVar.R
HypeMultiVar | R Documentation |
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.
HypeMultiVar(
x,
datetime,
hype.var,
hype.unit,
subid = NULL,
outregid = NULL,
hype.comment = ""
)
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. |
S3 class constructor function for array objects which can hold (multiple) HYPE basin output results.
Returns a 3-dimensional array with
[time, variable, iteration]
dimensions and additional attributes
:
A vector of date-times. Corresponds to 1st array dimension.
A character vector of HYPE output variable IDs.
A character vector of HYPE output variable units.
A single SUBID.
A single OUTREGID.
A character keyword for the time step.
A comment string, currently used for class group outputs.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.