Commit 8c6a7a10 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

0.2.8.11 UPDATE: CalGR argument deprecated in the SimGR function (replaced by...

0.2.8.11 UPDATE: CalGR argument deprecated in the SimGR function (replaced by the use of the param argument)
parent 0ca8a9b9
Package: airGRteaching
Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.8.10
Version: 0.2.8.11
Date: 2020-02-05
Authors@R: c(
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
......@@ -14,32 +14,37 @@ output:
### 0.2.8.10 Release Notes (2020-02-05)
### 0.2.8.11 Release Notes (2020-02-05)
#### New features
- added <code>as.data.frame.airGRt()</code> method in order to create a <code>data.frame</code> from outputs of <code>PrepGR()</code>, <code>CalGR()</code> and <code>SimGR()</code> functions. This <code>data.frame</code> always presents the same structure and contains (observed flow, simulated flow, simulated solid precipitation fraction, etc.). Wwhen it doesn't make sense a columns contains <code>NA</code> values (e.g. Qims with the <code>PrepGR()</code> function).
- added <code>as.data.frame.airGRt()</code> method in order to create a <code>data.frame</code> from outputs of <code>PrepGR()</code>, <code>CalGR()</code> and <code>SimGR()</code> functions. This <code>data.frame</code> always presents the same structure and contains (observed flow, simulated flow, simulated solid precipitation fraction, etc.). Wwhen it doesn't make sense a columns contains <code>NA</code> values (e.g. Qims with the <code>PrepGR()</code> function)
- a digital object identifier (DOI) now allows to identify the manual of the airGRteaching package. When you use airGRteaching in your work, please always cite both the article and the manual. The last one allows to know the version of the package that is used in order to enhance reproducible research. The references can be displayed with the <code>citation("airGRteaching")</code> command.
- a digital object identifier (DOI) now allows to identify the manual of the airGRteaching package. When you use airGRteaching in your work, please always cite both the article and the manual. The last one allows to know the version of the package that is used in order to enhance reproducible research. The references can be displayed with the <code>citation("airGRteaching")</code> command
#### Deprecated and defunct
- The <code>CalGR</code> argument is now deprecated in the <code>SimGR()</code> function. It has been replaced by the use of the <code>param</code> argument which can be set by an object of the calss <code>CalGR</code> or vector of parameters
#### Bug fixes
- <code>ShinyGR()</code> now runs when independent arguments (<code>DatesR</code>, <code>Precip</code>, etc.) are used instead of the <code>ObsDF</code> argument.
- <code>ShinyGR()</code> now runs when independent arguments (<code>DatesR</code>, <code>Precip</code>, etc.) are used instead of the <code>ObsDF</code> argument
#### User-visible changes
- when the package is loaded, a message warns the users if they use a version of 'htmlwidgets' < 1.5.1.9000. The latest version of this package, available on GitHub, avoids troubles with the use of dynamic graphics of the 'dygraphs' package (called by the <code>dyplot&#42;()</code> and the <code>ShinyGR()</code> functions)
- it is now possible to use the GR4H and GR5H hourly models with or whithout CemaNeige. For that, in the <code>PrepGR()</code>, the <code>HydroModel</code> argument could be set to <code>"GR4H"</code> or <code>"GR5H"</code>. In the GUI, launched by <code>ShinyGR()</code> function, nothing changed, only the daily models are available. So, now airGRteachinf depends on the version of airGR >= 1.4.3.52).
- it is now possible to use the GR4H and GR5H hourly models with or whithout CemaNeige. For that, in the <code>PrepGR()</code>, the <code>HydroModel</code> argument could be set to <code>"GR4H"</code> or <code>"GR5H"</code>. In the GUI, launched by <code>ShinyGR()</code> function, nothing changed, only the daily models are available. So, now airGRteachinf depends on the version of airGR >= 1.4.3.52)
- the <code>plot()</code> function is now exported.
- the <code>dyplot.PrepGR()</code>, <code>dyplot.CalGR()</code> and <code>dyplot.SimGR()</code> functions are no longer exported.
- the <code>dyplot.PrepGR()</code>, <code>dyplot.CalGR()</code> and <code>dyplot.SimGR()</code> functions are no longer exported
- the is now only one help page for all <code>plot.&#42;()</code> functions (use <code>?plot</code> to call it).
- the is now only one help page for all <code>plot.&#42;()</code> functions (use <code>?plot</code> to call it)
____________________________________________________________________________________
......@@ -289,6 +294,7 @@ ________________________________________________________________________________
- deprecated <code>Param</code> arguments in <code>ShinyGR()</code>
#### User-visible changes
- the size of the "Model performance" plot is now adapted if CemaNeige is used or not
......
SimGR <- function(PrepGR, CalGR = NULL, Param = NULL, EffCrit = c("NSE", "KGE", "KGE2", "RMSE"),
SimGR <- function(PrepGR, CalGR = NULL, Param, EffCrit = c("NSE", "KGE", "KGE2", "RMSE"),
WupPer = NULL, SimPer, transfo = c("", "sqrt", "log", "inv", "sort"), verbose = TRUE) {
if (! any(class(PrepGR) %in% "PrepGR")) {
stop("Non convenient data for argument \"PrepGR\". Must be of class \"PrepGR\"")
}
if (!missing(CalGR)) {
warning("Deprecated \"CalGR\" argument. Use \"Param\" instead")
}
### to remove when the CalGR will be removed
if (missing(Param)) {
Param <- NULL
}
if (! any(class(CalGR) %in% "CalGR") & !is.null(CalGR)) {
stop("Non convenient data for argument \"CalGR\". Must be of class \"CalGR\"")
}
if (is.null(CalGR) & is.null(Param)) {
stop("Arguments \"CalGR\" and \"Param\" are missing, with no default. You must fill in one of these two arguments")
}
if (is.null(Param)) {
Param <- CalGR$OutputsCalib$ParamFinalR
}
###
if (inherits(Param, "CalGR")) {
Param <- Param$OutputsCalib$ParamFinalR
}
WupInd <- NULL
if (!is.null(WupPer)) {
......
......@@ -10,7 +10,7 @@
\usage{
SimGR(PrepGR, CalGR = NULL, Param = NULL, EffCrit = c("NSE", "KGE", "KGE2", "RMSE"),
SimGR(PrepGR, CalGR = NULL, Param, EffCrit = c("NSE", "KGE", "KGE2", "RMSE"),
WupPer = NULL, SimPer,
transfo = c("", "sqrt", "log", "inv", "sort"), verbose = TRUE)
}
......@@ -19,9 +19,10 @@ SimGR(PrepGR, CalGR = NULL, Param = NULL, EffCrit = c("NSE", "KGE", "KGE2", "RMS
\arguments{
\item{PrepGR}{[object of class \emph{PrepGR}] see \code{\link{PrepGR}} for details}
\item{CalGR}{(optional) [object of class \emph{CalGR}] see \code{\link{CalGR}} and below for details}
\item{CalGR}{(deprecated) [object of class \emph{CalGR}] see \code{\link{CalGR}} and below for details}
\item{Param}{(optional) [numeric] vector of parameters (the length of the vector depends on the model used), see below for details}
\item{Param}{(optional) [object of class \emph{CalGR}] see \code{\link{CalGR}} \cr
or [numeric] vector of parameters (the length of the vector depends on the model used), see below for details}
\item{EffCrit}{[character] name of the efficiency criterion (must be one of \code{"NSE"}, \code{"KGE"}, \code{"KGE2"} or \code{"RMSE"})}
......@@ -56,7 +57,7 @@ SimGR(PrepGR, CalGR = NULL, Param = NULL, EffCrit = c("NSE", "KGE", "KGE2", "RMS
\details{
The user can customize the parameters with the \code{Param} argument.
The user can also use the parameters resulting from a calibration. In this case, it is necessary to use the \code{CalGR} argument.
The user can also use the parameters resulting from a calibration. In this case, it is necessary to use the \code{\link{CalGR}} function.
}
\author{Olivier Delaigue}
......@@ -77,7 +78,7 @@ CAL <- CalGR(PrepGR = PREP, CalCrit = "KGE2",
WupPer = NULL, CalPer = c("1990-01-01", "1993-12-31"))
## Simulation step using the result of the automatic calibration method to set the model parameters
SIM <- SimGR(PrepGR = PREP, CalGR = CAL, EffCrit = "KGE2",
SIM <- SimGR(PrepGR = PREP, Param = CAL, EffCrit = "KGE2",
WupPer = NULL, SimPer = c("1994-01-01", "1998-12-31"))
## Simulation step using model parameters set by the user
......
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