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

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

parent 8d55eda0
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.6.7
Version: 1.0.6.8
Date: 2017-04-05
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")),
......
......@@ -142,11 +142,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
}
if (!is.null(BasinArea)) {
# function to use switch avoiding a NOTE when the package is check
UNIT_M3S <- function(x) {
return(switch(x, hour = 60*60, day = 24*60*60, month = 365.25/12*24*60*60, year = 365.25*24*60*60))
}
Factor_UNIT_M3S <- BasinArea/(UNIT_M3S(NameTS)/1e3)
Factor_MMH_M3S <- 60 * 60
Factor_MMD_M3S <- 60 * 60 * 24
Factor_MMM_M3S <- 60 * 60 * 24 * 365.25 / 12
Factor_MMY_M3S <- 60 * 60 * 24 * 365.25
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)
}
}
......
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