ReadSubass: Read a 'subassX.txt' file

View source: R/functioncollection_import.R

ReadSubassR Documentation

Read a 'subassX.txt' file

Description

This is a convenience wrapper function to import an subassX.txt sub-basin assessment file as data frame into R. Sub-basins assessment files contain performance criteria results, as defined in 'info.txt', for individual sub-basins with observations.

Usage

ReadSubass(
  filename = "subass1.txt",
  nhour = NULL,
  check.names = FALSE,
  na.strings = c("****************", "-9999")
)

Arguments

filename

Path to and file name of the 'subassX.txt' file to import.

nhour

Integer, time step of sub-daily model results in hours. See details.

check.names

Logical. If TRUE, then the names of the variables are check to make sure they are syntactically valid.

na.strings

Vector of strings that should be read as NA.

Details

ReadSubass imports a sub-basin assessment file into R. Information on model variables evaluated in the file is imported as additional attributes variables, the evaluation time step in an attribute timestep.

Sub-daily time steps are reported with time step code '0' in HYPE result files. In order to preserve the time step information in the imported R object, users must provide the actual model evaluation time step in hours in argument nhour in the sub-daily case.

Value

ReadSubass returns a data frame with two additional attributes: variables contains a 2-element character vector with IDs of evaluated observed and simulated HYPE variables, timestep contains a character keyword detailing the evaluation time step.

Examples

te <- ReadSubass(filename = system.file("demo_model",
"results", "subass1.txt", package = "HYPEtools"))
te


HYPEtools documentation built on Sept. 11, 2024, 8:34 p.m.