From 3b18843ee2df7f0af94a55c0a8e8690fbe158349 Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.fr> Date: Thu, 29 Aug 2024 12:51:22 +0200 Subject: [PATCH] refactor: stop 'plot.OutputsModel' if 'IndPeriod_Plot' is not correct Refs: #192 --- R/plot.OutputsModel.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/plot.OutputsModel.R b/R/plot.OutputsModel.R index a5516cc..e90893e 100644 --- a/R/plot.OutputsModel.R +++ b/R/plot.OutputsModel.R @@ -19,9 +19,9 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = ## index time series if (!is.null(IndPeriod_Plot)) { - if (length(IndPeriod_Plot) == 0 || any(IndPeriod_Plot <= 0)) { + if (length(IndPeriod_Plot) <= 1 || any(IndPeriod_Plot <= 0)) { IndPeriod_Plot <- seq_along(OutputsModel$DatesR) - warning('IndPeriod_Plot') + stop('IndPeriod_Plot must be a positive vector of length > 0') } # IndPeriod_Plot <- seq_along(IndPeriod_Plot) OutputsModel <- .IndexOutputsModel(OutputsModel, IndPeriod_Plot) -- GitLab