diff --git a/R/plot_NparOF.R b/R/plot_NparOF.R index 7ab0c3b2c0b4448d6b4692c7280e483338a8d9a8..c701eab042971b9c98e6609b10727e86357d0de9 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 7856f7d981d89c8af12af79e70f71336c9a9ace1..8880f21e7ddea980b392c1b84fc130fd4dbce6ae 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) )