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
parent e35dcfdc
Pipeline #26036 passed with stage
in 10 minutes and 37 seconds
......@@ -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")
}
......
Markdown is supported
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