Commit 1f7169aa authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.1.2.2 UPDATE: ErrorCrit_KGE2 compatible with new InputsCrit objects

Showing with 6 additions and 2 deletions
+6 -2
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.1.2.1 Version: 1.1.2.2
Date: 2018-10-22 Date: 2018-10-22
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -6,6 +6,10 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = ...@@ -6,6 +6,10 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
stop("InputsCrit must be of class 'InputsCrit' \n") stop("InputsCrit must be of class 'InputsCrit' \n")
return(NULL) return(NULL)
} }
if (inherits(InputsCrit, "Multi") | inherits(InputsCrit, "Compo")) {
stop("InputsCrit must be of class 'Single' \n")
return(NULL)
}
if (!inherits(OutputsModel, "OutputsModel")) { if (!inherits(OutputsModel, "OutputsModel")) {
stop("OutputsModel must be of class 'OutputsModel' \n") stop("OutputsModel must be of class 'OutputsModel' \n")
return(NULL) return(NULL)
...@@ -36,7 +40,7 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = ...@@ -36,7 +40,7 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Data_preparation_______________________________ ##Data_preparation_______________________________
VarObs <- InputsCrit$Qobs VarObs <- InputsCrit$obs
VarObs[!InputsCrit$BoolCrit] <- NA VarObs[!InputsCrit$BoolCrit] <- NA
VarSim <- OutputsModel$Qsim VarSim <- OutputsModel$Qsim
VarSim[!InputsCrit$BoolCrit] <- NA VarSim[!InputsCrit$BoolCrit] <- NA
......
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