read_rsv: read_rsv

Description Usage Arguments Author(s)

View source: R/read_rsv.R

Description

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

Usage

1
2
read_rsv(file="output.rsv", out.type="Q", rsvID=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 8 columns): c("RES", "MON", "VOLUMEm3", "FLOW_INcms", "FLOW_OUTcms", "PRECIPm3", "EVAPm3", "SEEPAGEm3")
-) "Q+Sed" : only results related to water quantity AND sediments are read (first 11 columns): The previously mentioned 8 along with c("SED_INtons", "SED_OUTtons", "SED_CONCppm")
-) "Q+Sed+WQ": all the columns of the 'output.rsv' are read

rsvID

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

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

Date.Ini

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