Commit ddac1888 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.16.7 BUG: plot.OutputsModel runs when which argument contains "CorQQ" without "CumFreq"

Showing with 18 additions and 5 deletions
+18 -5
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.16.6 Version: 1.2.16.7
Date: 2019-05-24 Date: 2019-05-24
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -14,7 +14,7 @@ output: ...@@ -14,7 +14,7 @@ output:
### 1.2.16.6 Release Notes (2019-05-23) ### 1.2.16.7 Release Notes (2019-05-23)
#### New features #### New features
...@@ -23,6 +23,10 @@ output: ...@@ -23,6 +23,10 @@ output:
- <code>plot.OutputsModel()</code> now presents a <code>LayoutMat</code> argument (and additionnal related argument: <code>LayoutWidths</code>, <code>LayoutHeights</code>) to specify complex plot arrangements. - <code>plot.OutputsModel()</code> now presents a <code>LayoutMat</code> argument (and additionnal related argument: <code>LayoutWidths</code>, <code>LayoutHeights</code>) to specify complex plot arrangements.
#### Bug fixes
- Fixed bug in <code>plot.OutputsModel()</code>. The function now runs correctly when the <code>which</code> argument contains the <code>"CorQQ"</code> value without <code>"CumFreq"</code>.
#### Major user-visible changes #### Major user-visible changes
......
...@@ -193,6 +193,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = ...@@ -193,6 +193,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
SelectQsimNotZero <- round(OutputsModel$Qsim[IndPeriod_Plot], 4) != 0 SelectQsimNotZero <- round(OutputsModel$Qsim[IndPeriod_Plot], 4) != 0
BOOL_QsimZero <- sum(!SelectQsimNotZero, na.rm = TRUE) > 0 BOOL_QsimZero <- sum(!SelectQsimNotZero, na.rm = TRUE) > 0
} }
if ( BOOL_Qobs & !BOOL_Qsim) {
SelectNotZero <- SelectQobsNotZero
}
if (!BOOL_Qobs & BOOL_Qsim) {
SelectNotZero <- SelectQsimNotZero
}
if ( BOOL_Qobs & BOOL_Qsim) {
SelectNotZero <- SelectQobsNotZero & SelectQsimNotZero
}
if (BOOL_QobsZero & verbose) { if (BOOL_QobsZero & verbose) {
warning("zeroes detected in 'Qobs': some plots in the log space will not be created using all time-steps") warning("zeroes detected in 'Qobs': some plots in the log space will not be created using all time-steps")
} }
...@@ -765,15 +774,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = ...@@ -765,15 +774,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
par(new = FALSE, mar = mar) par(new = FALSE, mar = mar)
xlim <- c(0, 1) xlim <- c(0, 1)
if ( BOOL_Qobs & !BOOL_Qsim) { if ( BOOL_Qobs & !BOOL_Qsim) {
SelectNotZero <- SelectQobsNotZero # SelectNotZero <- SelectQobsNotZero
ylim <- range(log(Qobs[IndPeriod_Plot][SelectNotZero]), na.rm = TRUE) ylim <- range(log(Qobs[IndPeriod_Plot][SelectNotZero]), na.rm = TRUE)
} }
if (!BOOL_Qobs & BOOL_Qsim) { if (!BOOL_Qobs & BOOL_Qsim) {
SelectNotZero <- SelectQsimNotZero # SelectNotZero <- SelectQsimNotZero
ylim <- range(log(OutputsModel$Qsim[IndPeriod_Plot][SelectNotZero]), na.rm = TRUE) ylim <- range(log(OutputsModel$Qsim[IndPeriod_Plot][SelectNotZero]), na.rm = TRUE)
} }
if ( BOOL_Qobs & BOOL_Qsim) { if ( BOOL_Qobs & BOOL_Qsim) {
SelectNotZero <- SelectQobsNotZero & SelectQsimNotZero # SelectNotZero <- SelectQobsNotZero & SelectQsimNotZero
ylim <- range(log(c(Qobs[IndPeriod_Plot][SelectNotZero], OutputsModel$Qsim[IndPeriod_Plot][SelectNotZero])), na.rm = TRUE) ylim <- range(log(c(Qobs[IndPeriod_Plot][SelectNotZero], OutputsModel$Qsim[IndPeriod_Plot][SelectNotZero])), na.rm = TRUE)
} }
SelectNotZero <- ifelse(is.na(SelectNotZero), FALSE, SelectNotZero) SelectNotZero <- ifelse(is.na(SelectNotZero), FALSE, SelectNotZero)
......
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