rvn_forcings_read is used to read in the ForcingFunctions.csv file produced by the modelling Framework Raven.

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

Arguments

ff

full file path to the ForcingFunctions.csv file

tzone

string indicating the timezone of the data in ff

Value

forcings

data frame from the file with standardized names

units

vector corresponding to units of each column

Details

Expects a full file path to the ForcingFunctions.csv file, then reads in the file using read.csv. The main advantage of this functon is renaming the columns to nicer names and extracting the units into something much easier to read.

ff is the full file path of the ForcingFunctions.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.

See also

rvn_hyd_read for reading in the Hydrographs.csv file

Examples


# read in sample forcings data
ff <- system.file("extdata","run1_ForcingFunctions.csv", package="RavenR")
myforcings <- rvn_forcings_read(ff)

# check data (first 5 columns for brevity)
head(myforcings$forcings[,1:5])
#>            day_angle     rain snow    temp temp_daily_min
#> 2002-10-01   4.70809 3.468690    0 22.5956       17.92510
#> 2002-10-02   4.70809 3.468690    0 22.5956       17.92510
#> 2002-10-03   4.72530 1.189180    0 19.2076       15.40780
#> 2002-10-04   4.74251 2.083260    0 13.3714       11.49870
#> 2002-10-05   4.75973 6.474310    0 19.0304       12.50970
#> 2002-10-06   4.77694 0.125591    0 11.0186        7.43466
summary(myforcings$forcings[,1:5])
#>      Index                       day_angle             rain       
#>  Min.   :2002-10-01 00:00:00   Min.   :0.008584   Min.   : 0.000  
#>  1st Qu.:2003-04-01 12:00:00   1st Qu.:1.572950   1st Qu.: 0.000  
#>  Median :2003-10-01 00:00:00   Median :3.141590   Median : 0.000  
#>  Mean   :2003-10-01 00:00:00   Mean   :3.141338   Mean   : 1.776  
#>  3rd Qu.:2004-03-31 12:00:00   3rd Qu.:4.708090   3rd Qu.: 1.247  
#>  Max.   :2004-09-30 00:00:00   Max.   :6.274580   Max.   :34.788  
#>       snow              temp         temp_daily_min   
#>  Min.   :0.00000   Min.   :-21.627   Min.   :-31.271  
#>  1st Qu.:0.00000   1st Qu.: -1.721   1st Qu.: -5.142  
#>  Median :0.00000   Median :  7.114   Median :  3.054  
#>  Mean   :0.29746   Mean   :  6.555   Mean   :  1.785  
#>  3rd Qu.:0.03083   3rd Qu.: 16.123   3rd Qu.: 10.687  
#>  Max.   :8.62851   Max.   : 25.294   Max.   : 21.104