Commit 9c2f366f authored by Delaigue Olivier's avatar Delaigue Olivier Committed by Dorchies David
Browse files

v1.4.4.16 NEW: TimeLag argument now checked in SeriesAggreg2

Showing with 14 additions and 3 deletions
+14 -3
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.4.15
Version: 1.4.4.16
Date: 2020-04-09
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -4,7 +4,7 @@
### 1.4.4.15 Release Notes (2020-04-09)
### 1.4.4.16 Release Notes (2020-04-09)
#### New features
......
......@@ -39,7 +39,7 @@ SeriesAggreg2 <- function(TabSeries, Format, ConvertFun,
)
}
## check YearFirstMonth
msgYearFirstMonth <- "'YearFirstMonth' should be a numeric value between 1 and 12"
msgYearFirstMonth <- "'YearFirstMonth' should be a single vector of numeric value between 1 and 12"
YearFirstMonth <- match(YearFirstMonth, 1:12)
if (anyNA(YearFirstMonth)) {
stop(msgYearFirstMonth)
......@@ -47,6 +47,17 @@ SeriesAggreg2 <- function(TabSeries, Format, ConvertFun,
if (length(YearFirstMonth) != 1) {
stop(msgYearFirstMonth)
}
## check TimeLag
msgTimeLag <- "'TimeLag' should be a single vector of a positive numeric value"
if (!is.vector(TimeLag)) {
stop(msgTimeLag)
}
if (!is.numeric(TimeLag)) {
stop(msgTimeLag)
}
if (length(TimeLag) != 1 | !any(TimeLag >= 0)) {
stop(msgTimeLag)
}
TabSeries0 <- TabSeries
......
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