read.swat.data.rch.2012: Read data from a reach (RCH) SWAT output file

Description Usage Arguments Value Author(s) See Also Examples

View source: R/read.swat.data.rch.2012.R

Description

This function reads data from an already opened SWAT reach (*.rch) file of the SWAT 2012 format.

Usage

1
2
read.swat.data.rch.2012(fileHandle, nrow.data, header = TRUE, nreach = 1,
  ireach = 1)

Arguments

fileHandle

open connection to a file; the pointer in the file has to point to the header row if 'header=TRUE'; if 'header=FALSE' it has to point to the first data row

nrow.data

number of data rows to read

header

logical: consider the first row as header row (or not) [default = TRUE]

nreach

integer: number of reaches in the file

ireach

integer: index of the reach's data to extract

Value

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).

Author(s)

Daniel Neumann, daniel.neumann@io-warnemuende.de

See Also

read.swat, read.river.mom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  
  # open file
  fileHandle <- file('output.rch', open="rt")
  
  # skip first 8 lines of meta data
  tmp <- readLines(fileHandle, n = 8)
  
  # read 100 lines of data
  data.out <- read.swat.data.2012(fileHandle, 100)
  
  # close file
  close(fileHandle)
  

neumannd/riverdata documentation built on March 4, 2020, 4:22 a.m.