check | R Documentation |
Checks if reservoirs in the system are correctly interconnected and if their time series share the same period.
check(system)
## S3 method for class 'wateres_system'
check(system)
system |
A |
A warning is given if:
any downstream reservoir does not exist in the system (NA is set instead of the downstream ID in the system to be returned),
a reservoir does not contain data of time step identical with the time step of the first reservoir (then it is removed and downstream IDs of affected reservoirs are adjusted),
a reservoir is not connected to the first reservoir in the system (it is removed),
for daily or hourly data, a reservoir has time series of length different from time series of the first reservoir,
for monthly data, a reservoir has not dates of time series identical to the first reservoir in the system (its time series are shortened or the reservoir is removed completely in case of no intersection).
An error occurs if the system structure forms a cycle.
A wateres_system
object with modified or removed reservoirs (which do not conform to the check rules).
period = seq(as.Date("2000-01-01"), by = "months", length.out = 24)
riv_data = data.frame(
Q = c(0.111, 0.339, 0.723, 0.165, 0.14, 0.088, 0.098, 0.052, 0.034, 0.022, 0.152, 0.162,
0.156, 0.19, 0.259, 0.142, 0.075, 0.054, 0.118, 0.119, 0.267, 0.105, 0.194, 0.126),
DTM = period)
riv = as.wateres(riv_data, 14.4e6, 754e3, id = "riv", down_id = "thar")
thar_data = data.frame(
Q = c(9.275, 32.586, 64.53, 16.702, 12.749, 9.646, 6.748, 6.645, 4.018, 3.523, 3.118, 4.009,
7.137, 20.377, 47.467, 15.501, 8.199, 7.014, 7.086, 6.769, 9.038, 4.859, 12.006, 22.218),
DTM = period)
thar = as.wateres(thar_data, 41.3e6, 2672e3, id = "thar")
sys = as.system(riv, thar)
sys_modif = check(sys)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.