Reads in the ReservoirStages.csv file produced by Raven.
rvn_res_read(ff = NA, tzone = "UTC")
full file path to the ReservoirStages.csv file
string indicating the timezone of the data in ff
data frame from the file with standardized names
Expects a full file path to the ReservoirStages.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.
This function is also built to support the rvn_res_extract
function, which uses
the object created here for extracting by reference to the columns named
here, for example sub24.
ff is the full file path of the ReservoirStages.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.
rvn_res_extract
for extraction tools related to the
rvn_res_read output file
# create full file path
ff <- system.file("extdata","ReservoirStages.csv", package="RavenR")
# read in the Reservoir file
myres <- rvn_res_read(ff)
# view contents
head(myres$res)
#> precip sub36 sub36_obs sub43
#> 2002-10-01 NA 214.8210 NA 192.5000
#> 2002-10-02 3.468690 214.8246 214.8210 192.4340
#> 2002-10-03 1.189180 214.8408 214.8210 192.3955
#> 2002-10-04 2.083260 214.8615 214.8219 192.3504
#> 2002-10-05 6.474310 214.8786 214.8219 192.2888
#> 2002-10-06 0.125591 214.8930 214.8219 192.2118
myres$units
#> [1] "mm/day" "m." "m3/s" "m."