Commit 43c54cc0 authored by unknown's avatar unknown
Browse files

v1.0.6.8 remove the using of the switch function (generate NOTE)

Showing with 10 additions and 6 deletions
+10 -6
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.0.6.7 Version: 1.0.6.8
Date: 2017-04-05 Date: 2017-04-05
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")), person("Laurent", "Coron", role = c("aut", "trl")),
......
...@@ -142,11 +142,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = ...@@ -142,11 +142,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
} }
if (!is.null(BasinArea)) { if (!is.null(BasinArea)) {
# function to use switch avoiding a NOTE when the package is check Factor_MMH_M3S <- 60 * 60
UNIT_M3S <- function(x) { Factor_MMD_M3S <- 60 * 60 * 24
return(switch(x, hour = 60*60, day = 24*60*60, month = 365.25/12*24*60*60, year = 365.25*24*60*60)) Factor_MMM_M3S <- 60 * 60 * 24 * 365.25 / 12
} Factor_MMY_M3S <- 60 * 60 * 24 * 365.25
Factor_UNIT_M3S <- BasinArea/(UNIT_M3S(NameTS)/1e3) if (NameTS == "hour" ) Factor_UNIT_M3S <- Factor_MMH_M3S
if (NameTS == "day" ) Factor_UNIT_M3S <- Factor_MMD_M3S
if (NameTS == "month") Factor_UNIT_M3S <- Factor_MMM_M3S
if (NameTS == "year" ) Factor_UNIT_M3S <- Factor_MMY_M3S
Factor_UNIT_M3S <- BasinArea / (Factor_UNIT_M3S / 1000)
} }
} }
......
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