Commit 13521c41 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.4.3.67 CLEAN: TimeFormat and NewTimeFormat arguments now checked using the...

v1.4.3.67 CLEAN: TimeFormat and NewTimeFormat arguments now checked using the match.arg function in SeriesAggreg
parent a505ad9a
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.3.66
Date: 2020-03-28
Version: 1.4.3.67
Date: 2020-03-29
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
......@@ -4,7 +4,7 @@
### 1.4.3.66 Release Notes (2020-01-29)
### 1.4.3.67 Release Notes (2020-03-29)
#### CRAN-compatibility updates
......
......@@ -29,37 +29,10 @@ SeriesAggreg <- function(TabSeries,
stop("'TabSeries' columns (other than the first one) be of numeric class")
}
}
if (is.null(TimeFormat)) {
stop("'TimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (!is.vector(TimeFormat)) {
stop("'TimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (!is.character(TimeFormat)) {
stop("'TimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (length(TimeFormat) != 1) {
stop("'TimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (! TimeFormat %in% c("hourly", "daily", "monthly", "yearly")) {
stop("'TimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
##check_NewTimeFormat
if (is.null(NewTimeFormat)) {
stop("'NewTimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (!is.vector(NewTimeFormat)) {
stop("'NewTimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (!is.character(NewTimeFormat)) {
stop("'NewTimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (length(NewTimeFormat) != 1) {
stop("'NewTimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
if (! NewTimeFormat %in% c("hourly", "daily", "monthly", "yearly")) {
stop("'NewTimeFormat' must be one of 'hourly', 'daily', 'monthly' or 'yearly'")
}
##check TimeFormat and NewTimeFormat
TimeStep <- c("hourly", "daily", "monthly", "yearly")
TimeFormat <- match.arg(TimeFormat , choices = TimeStep)
NewTimeFormat <- match.arg(NewTimeFormat, choices = TimeStep)
##check_ConvertFun
if (is.null(ConvertFun)) {
stop("'ConvertFun' must be a vector of character")
......
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