diff --git a/DESCRIPTION b/DESCRIPTION index 4a9e3e209f70a44ab4e79aaeafb70813915bb35d..b3347eac04c2f00dde87c1ee8fda5e873691d320 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.1.2.35 +Version: 1.1.2.36 Date: 2019-01-29 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NEWS.rmd b/NEWS.rmd index 254dcdaa4175a02bbf12d5c5d9e3aeac21f3d172..971c3b30fe02330da4ee99e49dafed72fec8c49f 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -13,7 +13,7 @@ output: -### 1.1.2.35 Release Notes (2019-01-29) +### 1.1.2.36 Release Notes (2019-01-29) diff --git a/R/CreateInputsCrit.R b/R/CreateInputsCrit.R index d45f4a1cb08ef23143e9ffe2ba11b46a5c4a417a..2c59f6251670f296d383b0311ed927b0e708bea2 100644 --- a/R/CreateInputsCrit.R +++ b/R/CreateInputsCrit.R @@ -134,6 +134,12 @@ CreateInputsCrit <- function(FUN_CRIT, return(NULL) } + ## check 'obs' + if (!is.vector(iListArgs2$obs) | length(iListArgs2$obs) != LLL | !is.numeric(iListArgs2$obs)) { + stop(sprintf("'obs' must be a (list of) vector(s) of numeric values of length %i \n", LLL), call. = FALSE) + return(NULL) + } + ## check 'BoolCrit' if (is.null(iListArgs2$BoolCrit)) { iListArgs2$BoolCrit <- rep(TRUE, length(iListArgs2$obs)) @@ -147,12 +153,6 @@ CreateInputsCrit <- function(FUN_CRIT, return(NULL) } - ## check 'obs' - if (!is.vector(iListArgs2$obs) | length(iListArgs2$obs) != LLL | !is.numeric(iListArgs2$obs)) { - stop("'obs' must be a (list of) vector(s) of numeric values \n", call. = FALSE) - return(NULL) - } - ## check 'varObs' if (!is.vector(iListArgs2$varObs) | length(iListArgs2$varObs) != 1 | !is.character(iListArgs2$varObs) | !all(iListArgs2$varObs %in% inVarObs)) { stop(msgVarObs, call. = FALSE)