From 3a4ec491b29342cd96db78853b9a38fab3da9177 Mon Sep 17 00:00:00 2001 From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com> Date: Mon, 19 Nov 2012 16:15:54 +0000 Subject: [PATCH] 'plot_NparOF.R: changed defaults for 'GoFcuts' argument --- R/plot_NparOF.R | 15 +++++++++++---- man/ReadPlot_params.Rd | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/R/plot_NparOF.R b/R/plot_NparOF.R index 7ab0c3b..c701eab 100755 --- a/R/plot_NparOF.R +++ b/R/plot_NparOF.R @@ -68,7 +68,7 @@ plot_NparOF <- function(params, # Checking 'param.names' for ( i in 1:npar) { if ( !(param.names[i] %in% colnames(params)) ) - stop("Invalid argument: The field '", param.names[i], "' doesn't exist in 'params'") + stop("Invalid argument: The field '", param.names[i], "' does not exist in 'params'") par.pos[i] <- which(colnames(params) == param.names[i]) } # FOR end @@ -98,11 +98,18 @@ plot_NparOF <- function(params, if (verbose) message( "[ Number of behavioural parameter sets: ", nbeh, " ]" ) } # IF end + + # If the user didn't provide 'GOFcuts', the 5 quantiles are used if (length(GOFcuts) == 1){ - if (GOFcuts=="auto") - GOFcuts <- unique( quantile( as.numeric(gofs), - probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1), na.rm=TRUE) ) + if (GOFcuts=="auto") { + ifelse(MinMax=="min", + GOFcuts <- unique( quantile( as.numeric(gofs), + #probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1), na.rm=TRUE) ), + probs=c(0, 0.5, 0.95, 0.97, 0.98, 0.99, 1), na.rm=TRUE) ), + GOFcuts <- unique( quantile( as.numeric(gofs), + probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1), na.rm=TRUE) ), + } # IF end } # IF end ############################################################################## diff --git a/man/ReadPlot_params.Rd b/man/ReadPlot_params.Rd index 7856f7d..8880f21 100755 --- a/man/ReadPlot_params.Rd +++ b/man/ReadPlot_params.Rd @@ -242,9 +242,9 @@ setwd("~") # Setting the seed set.seed(100) -# Runing PSO with the 'sphere' test function, writting the results to text files +# Runing PSO with the 'sphere' test function, writing the results to text files hydroPSO( - fn= "sphere", lower=rep(-100, nparam), upper=rep(100, nparam), + fn= sphere, lower=rep(-100, nparam), upper=rep(100, nparam), control=list(npart=2*nparam, maxit=100, write2disk=TRUE, plot=TRUE) ) -- GitLab