Commit 761254d5 authored by unknown's avatar unknown
Browse files

v1.0.9.72 new error message when the time step is wrong in data gave to CreateInputsModel

Showing with 3 additions and 2 deletions
+3 -2
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.9.71 Version: 1.0.9.72
Date: 2018-01-30 Date: 2018-01-30
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")), person("Laurent", "Coron", role = c("aut", "trl")),
......
...@@ -76,7 +76,8 @@ CreateInputsModel <- function(FUN_MOD, ...@@ -76,7 +76,8 @@ CreateInputsModel <- function(FUN_MOD,
DatesR <- as.POSIXlt(DatesR) DatesR <- as.POSIXlt(DatesR)
} }
if (difftime(tail(DatesR, 1), tail(DatesR, 2), units = "secs")[[1]] %in% TimeStep == FALSE) { if (difftime(tail(DatesR, 1), tail(DatesR, 2), units = "secs")[[1]] %in% TimeStep == FALSE) {
stop(paste( "the time step of the model inputs must be ", TimeStep, " seconds \n", sep = "")) TimeStepName <- grep("hourly|daily|monthly|yearly", ObjectClass, value = TRUE)
stop(paste0("The time step of the model inputs must be ", TimeStepName, "\n"))
return(NULL) return(NULL)
} }
if (any(duplicated(DatesR))) { if (any(duplicated(DatesR))) {
......
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