From c928a8f8fb317bb212e5a8ac8a2bff1b24e2a721 Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.fr> Date: Fri, 1 May 2020 09:54:42 +0200 Subject: [PATCH] v1.4.7.4 CLEAN: commented command lines removed from plot.OutputsModel function #56 --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- R/plot.OutputsModel.R | 13 ++++--------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 46f13e2c..3fd4ad07 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.4.7.3 -Date: 2020-04-30 +Version: 1.4.7.4 +Date: 2020-05-01 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 19623bbd..495cd011 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ -### 1.4.7.3 Release Notes (2020-04-30) +### 1.4.7.4 Release Notes (2020-05-01) #### New features diff --git a/R/plot.OutputsModel.R b/R/plot.OutputsModel.R index f80438cb..619e5ea9 100644 --- a/R/plot.OutputsModel.R +++ b/R/plot.OutputsModel.R @@ -159,23 +159,19 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = return(filter(x, filter = rep(1 / n, n), sides = 2, circular = TRUE)) } BOOL_TS <- FALSE - # TimeStep <- difftime(tail(OutputsModel$DatesR, 1), tail(OutputsModel$DatesR, 2), units = "secs")[[1]] - if (inherits(OutputsModel, "hourly")){# & - # TimeStep %in% (60 * 60)) { + if (inherits(OutputsModel, "hourly")) { BOOL_TS <- TRUE NameTS <- "hour" plotunit <- "[mm/h]" formatAxis <- "%m/%Y" } - if (inherits(OutputsModel, "daily")) {# & - # TimeStep %in% (24 * 60 * 60)) { + if (inherits(OutputsModel, "daily")) { BOOL_TS <- TRUE NameTS <- "day" plotunit <- "[mm/d]" formatAxis <- "%m/%Y" } - if (inherits(OutputsModel, "monthly")){# & - # TimeStep %in% (c(28, 29, 30, 31) * 24 * 60 * 60)) { + if (inherits(OutputsModel, "monthly")) { BOOL_TS <- TRUE NameTS <- "month" plotunit <- "[mm/month]" @@ -184,8 +180,7 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = OutputsModel$DatesR <- as.POSIXlt(format(OutputsModel$DatesR, format = "%Y-%m-01"), tz = "UTC", format = "%Y-%m-%d") } } - if (inherits(OutputsModel, "yearly")){#} & - # TimeStep %in% (c(365, 366) * 24 * 60 * 60)) { + if (inherits(OutputsModel, "yearly")) { BOOL_TS <- TRUE NameTS <- "year" plotunit <- "[mm/y]" -- GitLab