diff --git a/DESCRIPTION b/DESCRIPTION index 02f5bc7a743c1670183c2ca8a71844bdbaa9c42c..7def0fac7ea0e355830c07e293995190fa5a7950 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.6.8.31 -Date: 2020-12-22 +Version: 1.6.8.32 +Date: 2020-12-23 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"), diff --git a/NEWS.md b/NEWS.md index 0d597a1fda5eaeb157b3a2f1c12021e776f645ee..f32128778331da4728d239ca53797f85d7fe3e0b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ -### 1.6.8.31 Release Notes (2020-12-22) +### 1.6.8.32 Release Notes (2020-12-23) #### New features diff --git a/R/SeriesAggreg.data.frame.R b/R/SeriesAggreg.data.frame.R index 4be45d2749fd16630f74bfb369b1b423278b8259..efbd9bec12c341ed62e3d43c4c29014fa39dee32 100644 --- a/R/SeriesAggreg.data.frame.R +++ b/R/SeriesAggreg.data.frame.R @@ -35,19 +35,16 @@ SeriesAggreg.data.frame <- function(x, x[[1L]] <- as.POSIXct(x[[1L]]) } ## check x other columns (boolean converted to numeric) - apply( - x[, -1L, drop = FALSE], - MARGIN = 2, - FUN = function(iCol) { - if (!is.numeric(iCol)) { - stop("'x' columns (other than the first one) must be of numeric class") - } - } - ) + apply(x[, -1L, drop = FALSE], + MARGIN = 2, + FUN = function(iCol) { + if (!is.numeric(iCol)) { + stop("'x' columns (other than the first one) must be of numeric class") + } + }) ## check Format listFormat <- c("%Y%m%d", "%Y%m", "%Y", "%m", "%d") - Format <- - gsub(pattern = "[[:punct:]]+", replacement = "%", Format) + Format <- gsub(pattern = "[[:punct:]]+", replacement = "%", Format) Format <- match.arg(Format, choices = listFormat) ## check ConvertFun @@ -57,10 +54,7 @@ SeriesAggreg.data.frame <- function(x, stop("'ConvertFun' should be a one of 'sum' or 'mean'") } if (length(ConvertFun) != (ncol(x) - 1)) { - stop(sprintf( - "'ConvertFun' must be of length %i (ncol(x)-1)", - ncol(x) - 1 - )) + stop(sprintf("'ConvertFun' must be of length %i (ncol(x)-1)", ncol(x) - 1)) } ## check YearFirstMonth msgYearFirstMonth <- "'YearFirstMonth' should be a single vector of numeric value between 1 and 12"