Commit 69ea26c4 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.16.28 CLEAN: warning msg management improved in plot.OutputsModel fun

Showing with 6 additions and 5 deletions
+6 -5
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.16.27
Version: 1.2.16.28
Date: 2019-06-07
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -14,7 +14,7 @@ output:
### 1.2.16.27 Release Notes (2019-06-07)
### 1.2.16.28 Release Notes (2019-06-07)
#### New features
......
......@@ -70,6 +70,7 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
## check 'which'
whichNeedQobs <- c("Error", "CorQQ")
whichDashboard <- c("all", "synth", "ts", "perf")
whichAll <- c("Precip", "PotEvap", "Temp", "SnowPack", "Flows", "Error", "Regime", "CumFreq", "CorQQ")
whichSynth <- c("Precip" , "Temp", "SnowPack", "Flows" , "Regime", "CumFreq", "CorQQ")
......@@ -116,14 +117,14 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
which <- c(which, whichAll)
}
if (is.null(Qobs)) {
if (length(which) == 1 & any(which %in% c("CorQQ", "Error"))) {
if (length(which) == 1 & any(which %in% whichNeedQobs)) {
stop(sprintf("the %s plot(s) cannot be drawn if there is no 'Qobs'", shQuote(which)))
}
if (length(which) != 1 & any(which %in% c("CorQQ", "Error"))) {
if (length(which) != 1 & any(which %in% whichNeedQobs)) {
BOOL_CorQQ <- FALSE
BOOL_Error <- FALSE
warning(sprintf("the %s plot(s) cannot be drawn if there is no 'Qobs'",
paste0(shQuote(c("CorQQ", "Error")), collapse = " and ")))
paste0(shQuote(whichNeedQobs), collapse = " and ")))
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment