View source: R/demoTankModel.R
tankWrapper | R Documentation |
tankWrapper
is a wrapper function for a rainwater tank system model in foreSIGHT. This function is used in examples in function help files and vignettes.
This function may also be used as an example to create wrapper functions for other system models with scenarios generated using foreSIGHT in R
or other programming languages.
tankWrapper(data, systemArgs, metrics)
data |
data.frame; contains observed daily precipitation and temperature to be used to run the rain water tank system model in a data.frame with columns named year month day P Temp.
Note that the first three columns of the data.frame contain the year, month, and day of observation. The columns have to be named as specified.
Please refer data provided with the package that may be loaded using |
systemArgs |
a list; contains the input arguments to the rain water tank system model. The valid fields in the list are:
|
metrics |
string vector; the metrics of performance of the system model to be reported. The valid strings may be viewed using the function |
The function returns a list containing the calculated values of the performance metrics specified in metrics
after running the system model.
runSystemModel
, viewTankMetrics
# view available performance metrics
viewTankMetrics()
# load example climate data to run the system model
data(tankDat)
systemArgs <- list(roofArea = 205, nPeople = 1, tankVol = 2400,
firstFlush = 2.0, write.file = FALSE)
tankWrapper(tank_obs, systemArgs,
metrics = c("average daily deficit (L)", "reliability (fraction)"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.