Commit 9d8f8b91 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

refactor(PE_Oudin): return a warning message instead an error when the time series is inconsistent

Refs #134
Showing with 2 additions and 2 deletions
+2 -2
...@@ -42,10 +42,10 @@ PE_Oudin <- function(JD, Temp, ...@@ -42,10 +42,10 @@ PE_Oudin <- function(JD, Temp,
TimeStepOut <- match.arg(TimeStepOut, choices = TimeStep) TimeStepOut <- match.arg(TimeStepOut, choices = TimeStep)
rleJD <- rle(JD) rleJD <- rle(JD)
if (TimeStepIn == "daily" & any(rleJD$lengths != 1)) { 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)) { 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")
} }
......
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