Running examples in 'hydroPSO-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: quant2ecdf
> ### Title: Simulated Values -> Empirical CDFs
> ### Aliases: quant2ecdf quant2ecdf.default quant2ecdf.matrix
> ###   quant2ecdf.data.frame
> ### Keywords: math manip graph
> 
> ### ** Examples
> 
> # random matrix with 100 simulated values (in columns) corresponding to 10
> # different behavioural parameter sets
> x <- matrix(rnorm(1000), ncol=10, nrow=100)
> 
> # empirical CDFs for the quantiles 0.05, 0.5 and 0.95, with equal weight for 
> # each parameter set
> quant2ecdf(sim=x, weights=1:10, byrow=FALSE) 
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
hydroPSO
 --- call from context --- 
quant2ecdf.default(sim = sim, weights = weights, byrow = byrow, 
    quantiles.desired = quantiles.desired, plot = plot, obs = obs, 
    quantiles.labels = quantiles.labels, main = main, ylab = ylab, 
    col = col, leg.cex = leg.cex, leg.pos = leg.pos, cex.axis = cex.axis, 
    cex.main = cex.main, cex.lab = cex.lab, verbose = verbose, 
    ...)
 --- call from argument --- 
if (is.na(match(class(sim), c("matrix", "data.frame")))) stop("Invalid argument: 'class(sim)' must be in c('matrix', 'data.frame')")
 --- R stacktrace ---
where 1: quant2ecdf.default(sim = sim, weights = weights, byrow = byrow, 
    quantiles.desired = quantiles.desired, plot = plot, obs = obs, 
    quantiles.labels = quantiles.labels, main = main, ylab = ylab, 
    col = col, leg.cex = leg.cex, leg.pos = leg.pos, cex.axis = cex.axis, 
    cex.main = cex.main, cex.lab = cex.lab, verbose = verbose, 
    ...)
where 2: quant2ecdf.matrix(sim = x, weights = 1:10, byrow = FALSE)
where 3: quant2ecdf(sim = x, weights = 1:10, byrow = FALSE)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (sim, weights = NULL, byrow = TRUE, quantiles.desired = c(0.05, 
    0.5, 0.95), plot = TRUE, obs = NULL, quantiles.labels = c("Q5", 
    "Q50", "Q95"), main = NULL, ylab = "Probability", col = "blue", 
    leg.cex = 1.2, leg.pos = "bottomright", cex.axis = 1.2, cex.main = 1.2, 
    cex.lab = 1.2, verbose = TRUE, ...) 
{
    if (is.na(match(class(sim), c("matrix", "data.frame")))) 
        stop("Invalid argument: 'class(sim)' must be in c('matrix', 'data.frame')")
    ifelse(byrow == TRUE, stg <- "ROW", stg <- "COLUMN")
    if (verbose) 
        message("[ Computing un-weighted quantiles for each ", 
            stg, " of 'sim' ... ]")
    q5.50.95 <- wquantile(sim, byrow = byrow, probs = quantiles.desired)
    nquantiles <- length(quantiles.desired)
    ecdf <- vector("list", nquantiles)
    if (plot) {
        old.par <- par(no.readonly = TRUE)
        par(mfrow = c(1, nquantiles))
        if (!is.null(main)) 
            par(oma = c(1, 1, 3, 0))
    }
    ifelse(is.null(weights), stg <- "the UN-weighted", stg <- "the weighted")
    for (i in 1:nquantiles) {
        if (verbose) 
            message("[ Computing ", stg, " ECDF for quantile ", 
                format(quantiles.desired[i], width = 5, justify = "left"), 
                " , ", i, "/", nquantiles, "=>", format(round(100 * 
                  i/nquantiles, 2), width = 7, justify = "left"), 
                "% ... ]")
        x.ecdf <- Hmisc::wtd.Ecdf(q5.50.95[, i], weights = weights, 
            normwt = TRUE)
        ecdf[[i]] <- x.ecdf
        names(ecdf)[i] <- quantiles.labels[i]
        if (plot) {
            if (!is.null(obs) & is.numeric(obs)) {
                if (is.na(match(class(obs), c("zoo", "numeric", 
                  "integer")))) 
                  stop("Invalid argument: 'class(obs)' must be in c('zoo', 'numeric', 'integer')")
                quantile.obs <- quantile(as.numeric(obs), probs = quantiles.desired[i], 
                  na.rm = TRUE)
            }
            main.loc <- paste("Empirical CDF of", quantiles.labels[i], 
                sep = " ")
            plot(x.ecdf$x, x.ecdf$ecdf, xlab = paste(quantiles.labels[i], 
                "[m3/s]", sep = " "), col = col, yaxt = "n", 
                type = "b", cex = 0.2, main = main.loc, ylab = ylab, 
                cex.axis = cex.axis, cex.main = cex.main, cex.lab = cex.lab, 
                font.lab = 2, ...)
            Axis(side = 2, at = seq(0, 1, by = 0.05), labels = FALSE, 
                cex.axis = cex.axis, cex.lab = cex.lab)
            Axis(side = 2, at = seq(0, 1, by = 0.1), labels = seq(0, 
                1, by = 0.1), cex.axis = cex.axis, cex.lab = cex.lab, 
                font.lab = 2)
            if (!is.null(obs) & is.numeric(obs)) 
                abline(v = quantile.obs, lty = 3, col = "black", 
                  lwd = 2)
            abline(h = 0.5, lty = 2, col = "grey", lwd = 2)
            f <- approxfun(x.ecdf$ecdf, x.ecdf$x)
            quantile.sim <- f(0.5)
            abline(v = quantile.sim, lty = 3, col = "grey", lwd = 2)
            if (!is.null(obs) & is.numeric(obs)) {
                bias <- 100 * (quantile.sim - quantile.obs)/quantile.obs
                if (bias == 0) 
                  txt.col <- "green"
                if (bias < 0) 
                  txt.col <- "red"
                if (bias > 0) 
                  txt.col <- "blue"
                leg.txt <- c(paste(quantiles.labels[i], "obs= ", 
                  round(quantile.obs, 2)), paste(quantiles.labels[i], 
                  "sim= ", round(quantile.sim, 2)), paste("Bias=", 
                  round(bias, 1), "[%]", sep = " "))
                legend(leg.pos, legend = leg.txt, inset = 0.02, 
                  bty = "n", cex = leg.cex, text.col = c("black", 
                    "black", txt.col))
            }
            else {
                leg.txt <- paste(quantiles.labels[i], "sim= ", 
                  round(quantile.sim, 3))
                legend(leg.pos, legend = leg.txt, bty = "n", 
                  cex = leg.cex)
            }
        }
    }
    if (plot) {
        if (!is.null(main)) 
            mtext(main, side = 3, line = 1, cex = cex.main, outer = TRUE)
    }
    return(ecdf)
}
<bytecode: 0x10319f8>
<environment: namespace:hydroPSO>
 --- function search by body ---
Function quant2ecdf.default in namespace hydroPSO has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (is.na(match(class(sim), c("matrix", "data.frame")))) stop("Invalid argument: 'class(sim)' must be in c('matrix', 'data.frame')") : 
  the condition has length > 1
Calls: quant2ecdf -> quant2ecdf.matrix -> quant2ecdf.default
Execution halted