Reads in output csv files produced by Raven.

rvn_csv_read(ff = NA, tzone = "UTC", xtsformat = TRUE)

Arguments

ff

full file path to the csv file

tzone

string indicating the timezone of the data in ff

xtsformat

boolean whether to return in xts format (if date and/or hour found)

Value

data frame (as xts if set with xtsformat) read from the file

Details

Expects a full file path to the Raven output file.

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.

See also

rvn_hyd_read for reading Hydrographs output files

Examples

# create full file path
ff <- system.file("extdata","ReservoirStages.csv", package="RavenR")

# read in the Reservoir file with the generic call
myres <- rvn_csv_read(ff)

# view contents
head(myres)
#>            time       date     hour precip_mm_day  sub36_m sub36_observed_m3_s
#> 2002-10-01    0 2002-10-01 00:00:00          <NA> 214.8210                <NA>
#> 2002-10-02    1 2002-10-02 00:00:00    3.46869000 214.8246            214.8210
#> 2002-10-03    2 2002-10-03 00:00:00    1.18918000 214.8408            214.8210
#> 2002-10-04    3 2002-10-04 00:00:00    2.08326000 214.8615            214.8219
#> 2002-10-05    4 2002-10-05 00:00:00    6.47431000 214.8786            214.8219
#> 2002-10-06    5 2002-10-06 00:00:00    0.12559100 214.8930            214.8219
#>             sub43_m
#> 2002-10-01 192.5000
#> 2002-10-02 192.4340
#> 2002-10-03 192.3955
#> 2002-10-04 192.3504
#> 2002-10-05 192.2888
#> 2002-10-06 192.2118