Learn R Programming

RavenR (version 2.2.0)

rvn_rvi_read: Read Raven .rvi (watershed discretization) file

Description

This routine reads in a valid Raven main input (.rvi) file and returns the information about hydrological processes as a data table.

Usage

rvn_rvi_read(filename)

Value

Returns a list with two items:

HydProcTable

a data table of hydrologic processes. Includes the following data columns: process type, algorithm, 'from' compartment, 'to' compartment, conditional (logical), and condition (character)

AliasTable

a table of aliases read from the rvi file, NULL if no aliases are included

Arguments

filename

the name of the .rvi file (with .rvi extension included), either relative to the working directory or absolute.

Author

James R. Craig, University of Waterloo

Details

This function does not like tabs in the .rvi file - it should be untabified first. Comma-delimited tables with a trailing comma are also problematic. The .rvi file can have arbitrary contents outside of the :HydrologicProcesses- :EndHydrologicProcesses block and :SubBasins-:EndSubBasins command blocks.

Examples

Run this code
# sample workflow of rvn_rvi_read
rvi <- system.file("extdata","Nith.rvi", package="RavenR") %>%
rvn_rvi_read(.)

# get number of Hydrologic processes
nrow(rvi$HydProcTable)

Run the code above in your browser using DataLab