Commit 0786007e authored by Delaigue Olivier's avatar Delaigue Olivier
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 4d89b26f
No related merge requests found
Showing with 9 additions and 4 deletions
+9 -4
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.8.0 Version: 1.4.8.1
Date: 2020-05-04 Date: 2020-05-04
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
### 1.4.8.0 Release Notes (2020-05-04) ### 1.4.8.1 Release Notes (2020-05-04)
#### New features #### New features
......
...@@ -28,6 +28,11 @@ SeriesAggreg2.default <- function(TabSeries, ...@@ -28,6 +28,11 @@ SeriesAggreg2.default <- function(TabSeries,
if (inherits(TabSeries, "CemaNeige")) { if (inherits(TabSeries, "CemaNeige")) {
if (inherits(TabSeries, "InputsModel")) { if (inherits(TabSeries, "InputsModel")) {
CemaNeigeLayers <- TabSeries[grep("^Layer", names(TabSeries))] 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") ){ if (inherits(TabSeries, "OutputsModel") ){
CemaNeigeLayers <- TabSeries$CemaNeigeLayers CemaNeigeLayers <- TabSeries$CemaNeigeLayers
...@@ -36,7 +41,7 @@ SeriesAggreg2.default <- function(TabSeries, ...@@ -36,7 +41,7 @@ SeriesAggreg2.default <- function(TabSeries,
tmp <- cbind(TabSeries$DatesR, as.data.frame(iLayer)) tmp <- cbind(TabSeries$DatesR, as.data.frame(iLayer))
res <- SeriesAggreg2(tmp, Format = Format, res <- SeriesAggreg2(tmp, Format = Format,
TimeFormat = TimeFormat, NewTimeFormat = NewTimeFormat, TimeFormat = TimeFormat, NewTimeFormat = NewTimeFormat,
ConvertFun = rep("sum", ncol(tmp)-1), ConvertFun = .AggregOutputs(gsub("[.].*", "", colnames(tmp)[-1L])),
YearFirstMonth = YearFirstMonth, TimeLag = TimeLag, YearFirstMonth = YearFirstMonth, TimeLag = TimeLag,
verbose = verbose) verbose = verbose)
res <- res[, -1L] res <- res[, -1L]
...@@ -49,7 +54,7 @@ SeriesAggreg2.default <- function(TabSeries, ...@@ -49,7 +54,7 @@ SeriesAggreg2.default <- function(TabSeries,
NewTabSeries <- SeriesAggreg2(TabSeries = TabSeries2, NewTabSeries <- SeriesAggreg2(TabSeries = TabSeries2,
Format = Format, Format = Format,
TimeFormat = TimeFormat, NewTimeFormat = NewTimeFormat, TimeFormat = TimeFormat, NewTimeFormat = NewTimeFormat,
ConvertFun = rep("sum", ncol(TabSeries2)-1), ConvertFun = .AggregOutputs(colnames(TabSeries2)[-1L]),
YearFirstMonth = YearFirstMonth, TimeLag = TimeLag, YearFirstMonth = YearFirstMonth, TimeLag = TimeLag,
verbose = verbose) verbose = verbose)
TabSeries$zzz <- NULL TabSeries$zzz <- NULL
......
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