rvn_watershedmeb_read: Read in Raven WatershedMassEnergyBalance file

View source: R/rvn_watershedmeb_read.R

rvn_watershedmeb_readR Documentation

Read in Raven WatershedMassEnergyBalance file

Description

Used to read in the WatershedMassEnergyBalance.csv file produced by the modelling Framework Raven.

Usage

rvn_watershedmeb_read(ff = NA, tzone = "UTC")

Arguments

ff

full file path to the WatershedMassEnergyBalance.csv file

tzone

string indicating the timezone of the data in ff

Details

Expects a full file path to the WatershedMassEnergyBalance.csv file, then reads in the file using read.csv. The main advantage of this function is renaming the columns to nicer names and extracting the units into something much easier to read. The from and to rows are also properly handled, which is not as straightforward as some of the other Raven files.

ff is the full file path of the WatershedMassEnergyBalance.csv file. If the file is located in the current working directory, then simply the name of the file is sufficient.

The timezone is provided by the tzone argument as "UTC" by default, and should be adjusted by the user to the local time zone as needed, based on the model run.

Value

watershedmeb

data frame from the file with standardized names

units

vector corresponding to units of each column

from

vector of the 'from' compartments in file

to

vector of the 'to' compartments in file

See Also

rvn_watershed_read for reading in the WatershedStorage.csv file

Examples

# locate RavenR Watershed Mass Energy Balance storage file
ff <- system.file("extdata","run1_WatershedMassEnergyBalance.csv", package="RavenR")

# read in file
mywshdmeb <- rvn_watershedmeb_read(ff)

# view mass energy balance time series
head(mywshdmeb$watershedmeb)

# view 'from' dataframe
mywshdmeb$from


rchlumsk/RavenR documentation built on April 19, 2024, 5:15 a.m.