From 9d8f8b91597a052e95cd8b3b5e04a3ad8b99e6d4 Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.fr> Date: Wed, 4 Aug 2021 14:09:19 +0200 Subject: [PATCH] refactor(PE_Oudin): return a warning message instead an error when the time series is inconsistent Refs #134 --- R/PE_Oudin.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/PE_Oudin.R b/R/PE_Oudin.R index 0f6c8352..7b748c54 100644 --- a/R/PE_Oudin.R +++ b/R/PE_Oudin.R @@ -42,10 +42,10 @@ PE_Oudin <- function(JD, Temp, TimeStepOut <- match.arg(TimeStepOut, choices = TimeStep) rleJD <- rle(JD) if (TimeStepIn == "daily" & any(rleJD$lengths != 1)) { - stop("each day must have only one identical value of julian days") + warning("each day should have only one identical value of julian days. The time series is not sorted, or contains duplicate or missing dates") } if (TimeStepIn == "hourly" & any(rleJD$lengths != 24)) { - stop("each day must have 24 identical values of julian days (one for each hour)") + warning("each day must have 24 identical values of julian days (one for each hour). The time series is not sorted, or contains duplicate or missing dates") } -- GitLab