From 1a28e685fecb0ee1fa8a3d4e2baada1b91af50ca Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Fri, 30 Apr 2021 11:53:36 +0200
Subject: [PATCH] refactor(pot.OutputsModel): replace the use of 'if' by 'else
 if' in order to check the time step Resf #122

---
 R/plot.OutputsModel.R | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/R/plot.OutputsModel.R b/R/plot.OutputsModel.R
index cbff3932..438b6e9a 100644
--- a/R/plot.OutputsModel.R
+++ b/R/plot.OutputsModel.R
@@ -168,18 +168,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
       BOOL_TS <- TRUE
       NameTS <- "hour"
       plotunit <- "[mm/h]"
-    }
-    if (inherits(OutputsModel, "daily")) {
+    } else if (inherits(OutputsModel, "daily")) {
       BOOL_TS <- TRUE
       NameTS <- "day"
       plotunit <- "[mm/d]"
-    }
-    if (inherits(OutputsModel, "monthly")) {
+    } else if (inherits(OutputsModel, "monthly")) {
       BOOL_TS <- TRUE
       NameTS <- "month"
       plotunit <- "[mm/month]"
-    }
-    if (inherits(OutputsModel, "yearly")) {
+    } else if (inherits(OutputsModel, "yearly")) {
       BOOL_TS <- TRUE
       NameTS <- "year"
       plotunit <- "[mm/y]"
-- 
GitLab