Commit 3cb331f8 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.4.2.4 CLEAN: checks of inputs revised in Imax fun #13

parent 7fbaabb5
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.2.3
Version: 1.4.2.4
Date: 2019-12-10
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -2,7 +2,7 @@
### 1.4.2.3 Release Notes (2019-12-10)
### 1.4.2.4 Release Notes (2019-12-10)
#### New features
......
......@@ -10,23 +10,23 @@ Imax <- function(InputsModel,
if (!inherits(InputsModel, "hourly")) {
stop("'InputsModel' must be of class 'hourly'")
}
if (!(class(tested_values) == "numeric")) {
stop("'tested_values' must be 'numeric'")
}
##check_IndPeriod_Run
if (!is.vector(IndPeriod_Run)) {
stop("'IndPeriod_Run' must be a vector of numeric values")
}
if (!is.numeric(IndPeriod_Run)) {
stop("'IndPeriod_Run' must be a vector of numeric values")
if (!inherits(IndPeriod_Run, "integer")) {
stop("'IndPeriod_Run' must be of type integer")
}
if (!identical(as.integer(IndPeriod_Run), as.integer(seq(from = IndPeriod_Run[1], to = tail(IndPeriod_Run, 1), by = 1)))) {
if (!identical(as.integer(IndPeriod_Run), IndPeriod_Run[1]:Ind_Run[length(IndPeriod_Run)])) {
stop("'IndPeriod_Run' must be a continuous sequence of integers")
}
if (storage.mode(IndPeriod_Run) != "integer") {
stop("'IndPeriod_Run' should be of type integer")
##tested_values
if (!(is.numeric(tested_values))) {
stop("'tested_values' must be 'numeric'")
}
##aggregate data at the daily time step
TabSeries <- data.frame(DatesR = InputsModel$DatesR[IndPeriod_Run],
......
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