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

1.4.8.1 fix: SeriesAggreg2.default now uses the right ConvertFun values by...

1.4.8.1 fix: SeriesAggreg2.default now uses the right ConvertFun values by using the .AggregOutputs function #41
parent 14f7dc8c
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.8.0
Version: 1.4.8.1
Date: 2020-05-04
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -4,7 +4,7 @@
### 1.4.8.0 Release Notes (2020-05-04)
### 1.4.8.1 Release Notes (2020-05-04)
#### New features
......
......@@ -28,6 +28,11 @@ SeriesAggreg2.default <- function(TabSeries,
if (inherits(TabSeries, "CemaNeige")) {
if (inherits(TabSeries, "InputsModel")) {
CemaNeigeLayers <- TabSeries[grep("^Layer", names(TabSeries))]
CemaNeigeLayers <- lapply(seq_along(CemaNeigeLayers), function(iLayer) {
tmp <- CemaNeigeLayers[[iLayer]]
names(tmp) <- paste(names(CemaNeigeLayers)[iLayer], names(tmp), sep = ".")
tmp
})
}
if (inherits(TabSeries, "OutputsModel") ){
CemaNeigeLayers <- TabSeries$CemaNeigeLayers
......@@ -36,7 +41,7 @@ SeriesAggreg2.default <- function(TabSeries,
tmp <- cbind(TabSeries$DatesR, as.data.frame(iLayer))
res <- SeriesAggreg2(tmp, Format = Format,
TimeFormat = TimeFormat, NewTimeFormat = NewTimeFormat,
ConvertFun = rep("sum", ncol(tmp)-1),
ConvertFun = .AggregOutputs(gsub("[.].*", "", colnames(tmp)[-1L])),
YearFirstMonth = YearFirstMonth, TimeLag = TimeLag,
verbose = verbose)
res <- res[, -1L]
......@@ -49,7 +54,7 @@ SeriesAggreg2.default <- function(TabSeries,
NewTabSeries <- SeriesAggreg2(TabSeries = TabSeries2,
Format = Format,
TimeFormat = TimeFormat, NewTimeFormat = NewTimeFormat,
ConvertFun = rep("sum", ncol(TabSeries2)-1),
ConvertFun = .AggregOutputs(colnames(TabSeries2)[-1L]),
YearFirstMonth = YearFirstMonth, TimeLag = TimeLag,
verbose = verbose)
TabSeries$zzz <- NULL
......
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