HypeXobs: HypeXobs data frames

View source: R/class_HypeXobs.R

HypeXobsR Documentation

HypeXobs data frames

Description

Constructor function for data frames which hold HYPE Xobs.txt file contents, i.e. time series of a multiple observation variables for multiple sub-basins and equidistant time steps in POSIXct format in the first column.

Usage

HypeXobs(x, comment, variable, subid, verbose = TRUE)

Arguments

x

data.frame with POSIXct formatted time steps in the first, and numeric variables in the remaining columns.

comment

Character string, metadata or other information, first line of a HYPE Xobs.txt file.

variable

Character vector of four-letter keywords to specify HYPE variable IDs, corresponding to second to last column in x.

subid

Integer vector with HYPE sub-basin IDs, corresponding to second to last column in x.

verbose

Logical, throw warning if attribute timestep cannot be computed.

Not case-sensitive.

Details

S3 class constructor function for HypeXobs data frame objects which hold HYPE Xobs.txt file contents. Xobs.txt files contain three header rows, see the Xobs.txt description in the HYPE documentation. These headers are stored as additional attributes in objects.

Value

Returns a data frame of class HypeXobs with additional attributes:

comment

A character vector.

variable

A character vector of HYPE variable IDs.

subid

A vector of SUBIDs.

timestep

Time step keyword, "day", or "n hour" (n = number of hours). NULL, if x contains just one row.

Examples

# Use the Xobs file import function instead of the class constructor for standard work flows
te <- ReadXobs(file = system.file("demo_model", "Xobs.txt", package = "HYPEtools"))
summary(te)
# Class constructor
HypeXobs(x = as.data.frame(te), comment = comment(te), variable = variable(te), subid = subid(te))


rcapell/HYPEtools documentation built on Feb. 28, 2024, 2:29 p.m.