read_hru: read_hru

Description Usage Arguments Author(s)

View source: R/read_hru.R

Description

Function for reading the 'output.hru' files of SWAT 2005 (regarding HRUs), and giving as output a data.frame with the columns of the read file.

Usage

1
2
read_hru(file="output.hru", out.type="Q", hruID=NA, col.names=NULL, tstep,                    
         Date.Ini, Date.Fin, date.fmt="%Y-%m-%d", verbose=TRUE)

Arguments

file

the name of the file which the data are to be read from. If it does not contain an _absolute_ path, the file name is _relative_ to the current working directory, 'getwd()'. Tilde-expansion is performed where supported.

out.type

Type of results that have to be read. It must be one of the following values:
-) "Q" : only results related to water quantity are read (first 35 columns): c("LULC", "HRU", "GIS", "SUB", "MGT", "MON", "AREAkm2", "PRECIPmm", "SNOFALLmm", "SNOMELTmm", "IRRmm", "PETmm", "ETmm", "SW_INITmm", "SW_ENDmm", "PERCmm", "GW_RCHGmm", "DA_RCHGmm", "REVAPmm", "SA_IRRmm", "DA_IRRmm", "SA_STmm", "DA_STmm", "SURQ_GENmm", "SURQ_CNTmm", "TLOSSmm", "LATQmm", "GW_Qmm", "WYLDmm", "DAILYCN", "TMP_AVdgC", "TMP_MXdgC", "TMP_MNdgC", "SOL_TMPdgC", "SOLARMJ/m2")
-) "Q+Sed" : only results related to water quantity AND sediments are read (first 37 columns): The previously mentioned 35 along with c("SYLDt/ha", "USLEt/ha")
-) "Q+Sed+WQ": all the columns of the 'output.hru' are read

hruID

OPTIONAL. Integer with the number of the HRU for wich the results will be provided.
If this argument is not provided, the results will be given for all the reaches in 'output.hru'

col.names

OPTIONAL. character with the column name in file that stores the results that the user wants to convert into a zoo object

tstep

Time step used for the simulation that created the ‘output.hru’ file.
It must be one of the following values: c("daily", "monthly", "annual"),

Date.Ini

OPTIONAL, only used when hruID is provided AND it is a unique number.
character with the starting date for the results that are stored in file, which is used to provide a zoo object as output.

Date.Fin

OPTIONAL, only used when hruID is provided AND it is a unique number.
character with the ending date for the results that are stored in file, which is used to provide a zoo object as output.

date.fmt

character, with the format used to define Date.Ini, Date.Fin. See 'format' in 'as.Date'.

verbose

logical; if TRUE, progress messages are printed

Author(s)

Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com


hzambran/SWAT2R documentation built on May 17, 2019, 10:07 p.m.