Description Usage Arguments Value Author(s) See Also Examples
Reads a SWAT output file of the *.rch (reach), *.sub, and *.hru formats. Currently, only the formats as documented in the SWAT 2012 handbook are supported.
1 2 |
filename |
character: name of the SWAT file |
filetype |
character: official file extension of SWAT output file ('rch', 'sub', 'hru') |
version |
integer/numeric: SWAT output version, only 2012 and 2016 (equal) are implemented |
variables |
character array of variable names (==columns) to read in from the file; if == NULL [default], all variables are read |
list containing a data.frame (out$data), a character array (out$units), and two character variables (out$format and out$tstep). The first contains the actual data formatted as a data.frame. The second contains the units to the corresponding columns of the data.frame. The third contains the source/format of data (here: 'swat'; can also be 'mom'). The fourth contains information on the time step of the data (resp.: on which time interval they are averaged).
The data.frame out$data which contains the data from the file 'filename'; column names of as.data.frame should be equal to column names in the reach file; only variables/columns listed in 'variables' are returned;
Daniel Neumann, daniel.neumann@io-warnemuende.de
read.swat.data.rch.2012, read.river.mom
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# read in a swat *.rch (reach) file
data.swat <- read.swat('output.rch')
# read in a swat *.sub file
data.swat <- read.swat('output.sub')
# NOTE: not implemented yet
# read in a swat reach file with another file extension
data.swat <- read.swat('output.txt', filetype = 'rch')
# read in specific variables of a swat *.rch (reach) file
data.swat <- read.swat('output.rch', variables = c('NO3_OUT', 'NH4_OUT'))
# NOTE: not implemented yet
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.