Learn R Programming

DWBmodelUN (version 1.0.0)

graphDWB: Graph for DWB model results

Description

This function dynamically graphs the inputs and results of the DWBmodelUN.

Usage

graphDWB(var, tp, main, ...)

Arguments

var

It is a list that contains a time series of type ts which you want to graph. For (tp = 2), it is recommended to list the simulated runoff series first, followed by the observed. For (tp = 3), it must first contain the observed precipitation series, followed by the simulated runoff series and finally the observed runoff. For (tp = 4), it must first contain the observed precipitation series, followed by the evapotranspiration series and finally the runoff time series.

tp

Variable which is defined to choose the type of graph.

main

Main title for the graph.

...

Other parameters of the dygraphs package.

Value

Prints a dynamic graph according to the requirements.

Details

It has three types of graphs:

  • (tp = 1): Plots any variable in a continuous format.

  • (tp = 2): Compares the runoff result of the model, with the observations.

  • (tp = 3): It allows to show a comparison between the observed and simulated runoff, as well as, with a dataset of precipitation.

  • (tp = 4): It presents a comparison between a set of precipitation, actual or potential evapotranspiration and runoff.

Examples

Run this code
# NOT RUN {
# Example 1
data(P_sogamoso)
P.est <- ts(c(t(P_sogamoso[1, -2:-1])), star = c(2001, 1), frequency = 12)
var <- list("Precipitation" = P.est)

graphDWB(var, tp = 1, main = "Precipitation Lat:7.0 Lon:-72.94")

# Example 2
data(simDWB.sogamoso, EscSogObs)
runoff.sim <- ts(simDWB.sogamoso[,25], star = c(2001, 1), frequency = 12)
runoff.obs <- ts(EscSogObs[,25] , star = c(2001, 1), frequency = 12)
var <- list("Runoff.sim" = runoff.sim, "Runoff.obs" = runoff.obs)

graphDWB(var, tp = 2, main = "Runoff at basin closure: Gauge 24067010")

# Example 3
data(P_sogamoso, simDWB.sogamoso, EscSogObs)
P.est <- ts(c(t(P_sogamoso[1, 15:110])), star = c(2002, 1), frequency = 12)
runoff.sim <- ts(simDWB.sogamoso[13:108 ,25], star = c(2002, 1), frequency = 12)
runoff.obs <- ts(EscSogObs[13:108 ,25] , star = c(2002, 1), frequency = 12)
var <- list("Precipitation" = P.est,"Runoff.sim" = runoff.sim, "Runoff.obs" = runoff.obs)

graphDWB(var, tp = 3, main = "DWB results at Sogamoso Basin closure point")

# Example 4
data(P_sogamoso, PET_sogamoso, simDWB.sogamoso)
P <- ts(c(t(P_sogamoso[1, -2:-1])), star = c(2001, 1), frequency = 12)
PET <- ts(c(t(PET_sogamoso[1, -2:-1])), star = c(2001, 1), frequency = 12)
runoff.sim <- ts(simDWB.sogamoso[ ,25], star = c(2001, 1), frequency = 12)
var <- list("P" = P,"PET" = PET, "Runoff.sim" = runoff.sim)

graphDWB(var, tp = 4, main = "General Comparison Sogamoso Basin")

# }

Run the code above in your browser using DataLab