From 312530e4f5fd569f8ca28d5e50a50d1e7ef3b664 Mon Sep 17 00:00:00 2001
From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com>
Date: Mon, 19 Nov 2012 23:29:27 +0000
Subject: [PATCH] plot\_NparOF.R: added checking for 'beh.thr'

---
 NEWS            | 2 ++
 R/params2ecdf.R | 5 +++++
 R/plot_NparOF.R | 6 ++++++
 3 files changed, 13 insertions(+)

diff --git a/NEWS b/NEWS
index 6655c05..c58ff79 100755
--- a/NEWS
+++ b/NEWS
@@ -109,6 +109,8 @@ NEWS/ChangeLog for hydroPSO
                               -) argument 'sim' may also be 'integer' (before it had to be 'numeric', which does not allow 'integer' objects !)  
 
         o 'plot_NparOF'     : -) new argument 'beh.thr' to allow selecting only behavioral parameter sets
+
+        o 'params2ecdf'     : -) new arguments 'gofs', 'MinMax' and 'beh.thr' 
                             
         o new function 'pest2hydroPSO' for importing PEST input files into hydroPSO
         o new function 'hydroPSO2pest' for exporting hydroPSO input files to PEST
diff --git a/R/params2ecdf.R b/R/params2ecdf.R
index 7eace84..c7791a1 100755
--- a/R/params2ecdf.R
+++ b/R/params2ecdf.R
@@ -36,6 +36,11 @@ params2ecdf <- function(params, ...) UseMethod("params2ecdf")
 ################################################################################
 params2ecdf.default <- function(params, 
                                 param.names=NULL,
+
+                                gofs,
+                                MinMax=NULL, 
+                                beh.thr=NA, 
+
                                 weights=NULL,                                                  
                                 byrow=FALSE, 
                                 plot=TRUE,
diff --git a/R/plot_NparOF.R b/R/plot_NparOF.R
index a573a06..2235177 100755
--- a/R/plot_NparOF.R
+++ b/R/plot_NparOF.R
@@ -59,6 +59,12 @@ plot_NparOF <- function(params,
     # Setting 'MinMax' 
     MinMax <- match.arg(MinMax)
 
+    # Checking 'beh.thr'
+    if ( !is.na(beh.thr) ) {       
+      if ( is.null(gofs) )
+        stop("Missing argument: 'gofs' has to be provided before using 'beh.thr' !!")
+    } # IF end
+
     # Number of parameters that will be analysed
     npar <- length(param.names)
 
-- 
GitLab