rvn_hyd_read is used to read in the Hydrographs.csv file produced by the modelling Framework Raven.

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

Arguments

ff

full file path to the Hydrographs.csv file

tzone

string indicating the timezone of the data in ff (default "UTC")

Value

hyd

data frame from the file with standardized names

Details

Expects a full file path to the Hydrographs.csv file, then reads in the file using fread. 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_hyd_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 Hydrographs.csv file. If the file is located in the current working directory, then simply the name of the file is sufficient.

tzone is a string indicating the timezone of the supplied Hydrographs file. The timezone provided is coded into the resulting hyd data frame using the as.POSIXct function. The timezone is provided as "UTC" by default, and should be adjusted by the user to the local time zone as needed, based on the model run.

See also

rvn_hyd_extract for extraction tools related to the rvn_hyd_read output file

Examples

# read in hydrograph sample csv data from RavenR package
ff <- system.file("extdata","run1_Hydrographs.csv", package="RavenR")

# read in Raven Hydrographs file, store into myhyd
myhyd <- rvn_hyd_read(ff)

# view contents
head(myhyd$hyd)
#>              precip    Sub36 Sub36_obs    Sub43 Sub43_obs
#> 2002-10-01       NA  5.96354        NA 11.25050        NA
#> 2002-10-02 3.468690 11.96430     0.801 18.59070      3.07
#> 2002-10-03 1.189180 15.43700     0.828 25.74430      2.99
#> 2002-10-04 2.083260  8.76948     0.860 18.68610      3.06
#> 2002-10-05 6.474310  4.66501     0.903  9.82648      2.93
#> 2002-10-06 0.125591  4.20829     1.040  7.90952      3.15
myhyd$units
#> [1] "mm/day" "m3/s"   "m3/s"   "m3/s"   "m3/s"