read_sub {SWAT2R}R Documentation

read_sub

Description

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

Usage

read_sub(file="output.sub", out.type="Q", subID=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 13 columns): c("SUB", "GIS", "MON", "AREAkm2", "PRECIPmm", "SNOMELTmm", "PETmm", "ETmm", "SWmm", "PERCmm", "SURQmm", "GW_Qmm", "WYLDmm")
-) "Q+Sed" : only results related to water quantity AND sediments are read (first 14 columns): The previously mentioned 13 along with "SYLDt/ha"
-) "Q+Sed+WQ": all the columns of the 'output.sub' are read

subID

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

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.sub’ file.
It must be one of the following values: c("daily", "monthly", "annual"),

Date.Ini

OPTIONAL, only used when subID 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 subID 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


[Package SWAT2R version 0.1-11 Index]