From e19aa68cc805b530a8f808a9dbe5fc04c11d275a Mon Sep 17 00:00:00 2001
From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com>
Date: Mon, 19 Nov 2012 22:52:15 +0000
Subject: [PATCH] params2ecdf.R:removed some un-necessary 'paste' commands

---
 NEWS               |  5 ++++-
 R/params2ecdf.R    | 16 ++++++++--------
 R/plot_particles.R |  7 +++++--
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index b8b0e09..6655c05 100755
--- a/NEWS
+++ b/NEWS
@@ -100,12 +100,15 @@ NEWS/ChangeLog for hydroPSO
 
         o 'plot_particles'  : -) new argument 'do.pairs' (by default 'do.pairs=FALSE'), to control if the correlation matrix among parameters has to be plotted or not
                                  (up to hydroPSO <=0.1.58 it was always plotted)
+                              -) arguments 'MinMax' and 'beh.thr' are now passed to 'plot_NparOF'
 
         o 'plot_results'    : -) new argument 'do.pairs' (by default 'do.pairs=FALSE'), to control if the correlation matrix among parameters has to be plotted or not
                                  (up to hydroPSO <=0.1.58 it was always plotted)
 
         o 'plot_out'        : -) argument 'MinMax' is not required any more!
-                              -) argument 'sim' may also be 'integer' (before it had to be 'numeric', which does not allow 'integer' objects !)      
+                              -) 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 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 9d5043d..7eace84 100755
--- a/R/params2ecdf.R
+++ b/R/params2ecdf.R
@@ -68,12 +68,12 @@ params2ecdf.default <- function(params,
     
  # Checking 'param.names'
  if (length(param.names) != nparam)
-   stop(paste("Invalid argument: 'length(param.names) = ", length(param.names), " != ", nparam, " = nparam'", sep=""))
+   stop("Invalid argument: 'length(param.names) = ", length(param.names), " != ", nparam, " = nparam'")
       
  # checking that the user provided 1 weight for each behavioural parameter set
  if ( !is.null(weights) ) {
    if (length(weights) != NROW(params) )
-     stop( paste("Invalid argument: 'length(w) != nrow(params)' (", length(weights), "!=", nrow(params), ")", sep="") )
+     stop("Invalid argument: 'length(w) != nrow(params)' (", length(weights), "!=", nrow(params), ")" )
  } # IF end
     
  # creating the final output, a list with the ECDFs 
@@ -143,12 +143,12 @@ params2ecdf.default <- function(params,
            char2 <- "ECDF"
          } # ELSE end
     
-       if (verbose) message( paste("[ Computing the ", char1, " for '", 
-                                 format(param.names[p], width=ncharmax), 
-                                 "' , ", p, "/", nparam.bak, " => ", 
-                                 format(round(100*i/nparam.bak, 2), width=5, 
-                                 nsmall=2, justify="left"),
-                                 "% ]", sep= "") )
+       if (verbose) message("[ Computing the ", char1, " for '", 
+                             format(param.names[p], width=ncharmax), 
+                             "' , ", p, "/", nparam.bak, " => ", 
+                             format(round(100*i/nparam.bak, 2), width=5, 
+                             nsmall=2, justify="left"),
+                             "% ]" )
     
        # Weighted ECDF for the "i-th" desired quantile, where the unweighted 
        # 'i-th' quantile of each behavioural parameter set is now weighted by the 
diff --git a/R/plot_particles.R b/R/plot_particles.R
index a32ca76..1b2dc26 100755
--- a/R/plot_particles.R
+++ b/R/plot_particles.R
@@ -8,7 +8,7 @@
 #                          'plot_particles'                                    # 
 # Author : Mauricio Zambrano-Bigiarini & Rodrigo Rojas                         #  
 # Started: 08-Nov-2011,                                                        #
-# Updates: 02-Feb-2012 ; 17-Feb-2012 ; 09-Mar-2012 ; 12-Nov-2012               #        
+# Updates: 02-Feb-2012 ; 17-Feb-2012 ; 09-Mar-2012 ; 12-Nov-2012 ; 19-Nov-2012 #        
 ################################################################################
 # This function plots the contents of the 'Particles.txt' ouput file of        #
 # hydroPSO, with the position and fitness value of all the particles in the    #
@@ -350,13 +350,16 @@ plot_particles <- function(#####################################################
                 params=params,
                 gofs=gofs,
                 param.names=dp3D.names,
+                MinMax=MinMax, 
+                beh.thr=beh.thr,
                 nrows=nrows,
                 gof.name=gof.name, 
                 main=main,
                 GOFcuts=GOFcuts,
                 colorRamp= colorRamp,
+                points.cex=points.cex,  
                 alpha=alpha,
-                points.cex=points.cex,               
+                #axis.rot=axis.rot,            
                 verbose=FALSE
                 ) 
     if (do.png) dev.off()
-- 
GitLab