Commit 84d498b2 authored by Delaigue Olivier's avatar Delaigue Olivier Committed by Dorchies David
Browse files

1.4.4.14 CLEAN: minor code revisions in SeriesAggreg

Showing with 5 additions and 6 deletions
+5 -6
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.4.13
Version: 1.4.4.14
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.13 Release Notes (2020-04-09)
### 1.4.4.14 Release Notes (2020-04-09)
#### New features
......
SeriesAggreg2 <- function(TabSeries, Format, ConvertFun,
SeriesAggreg2 <- function(TabSeries, Format, ConvertFun,
YearFirstMonth = 1, TimeLag = 0, verbose = TRUE) {
## Arguments_check
......@@ -50,10 +50,8 @@ SeriesAggreg2 <- function(TabSeries, Format, ConvertFun,
}
if (length(YearFirstMonth) != 1) {
stop(msgYearFirstMonth)
}
}
sp <- sprintf("%02.f", YearFirstMonth)
TabSeries0 <- TabSeries
TabSeries0$DatesR <- TabSeries0$DatesR + TimeLag
......@@ -81,6 +79,7 @@ SeriesAggreg2 <- function(TabSeries, Format, ConvertFun,
return(TabSeries)
}
if (Format == "%Y") {
sp <- sprintf("%02.f", YearFirstMonth)
spF1 <- "%m"
spF2 <- "%Y-%m"
TabSeries2$Selec1 <- format(TabSeries2$DatesR, spF1)
......
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