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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: getSigTests
> ### Title: Extract Significant Test Results for a Given Alpha or Different
> ###   Multiple Testing Corrections.
> ### Aliases: getSigTests
> ### Keywords: methods
> 
> ### ** Examples
> 
>   X <- matrix(c(rnorm(500,2,1),rnorm(600,2,1),rnorm(400,2.2,1)),byrow=TRUE, ncol=10)
>   colnames(X) <- letters[1:10]
>   g <- c(rep(1,50),rep(2,60),rep(3,40))
>   test <- gmw(X,g,test="kw",type="external")
>   cs1 <- getSigTests(test)
>   cs1
$sigTests
[1] 6

> 
>   simData <- runif(1000,0,1)
>   simData <- c(simData,runif(200,0,0.01))
>   simData2 <- runif(1000,0,1)
>   simData2 <- c(simData2,runif(200,0,0.01))
> 
>   simDataMat <- rbind(simData,simData2)
> 
>   getSigTests(simDataMat, method="bon")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
gMWT
 --- call from context --- 
getSigTests(simDataMat, method = "bon")
 --- call from argument --- 
if (class(pvalues) != "gmw") {
    temp <- pvalues
    pvalues <- list()
    pvalues$p.values <- temp
}
 --- R stacktrace ---
where 1: getSigTests(simDataMat, method = "bon")

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (pvalues, alpha = 0.05, method = "plain") 
{
    method <- match.arg(method, c("plain", "bonferroni", "simes", 
        "bh", "csD", "csR", "maxT"))
    ifelse((is.numeric(pvalues)) & (!is.matrix(pvalues)), isVector <- TRUE, 
        isVector <- FALSE)
    getSigTests.internal <- function(pvalues, alpha, method) {
        multAlpha <- NULL
        sigPvalues <- NULL
        sigTests <- NULL
        if (method == "plain") {
            sigTests <- which((pvalues <= alpha) == TRUE)
            sigPvalues <- pvalues[sigTests]
        }
        else if (method == "bonferroni") {
            bonAlpha <- alpha/length(pvalues)
            sigTests <- which((pvalues <= bonAlpha) == TRUE)
            sigPvalues <- pvalues[sigTests]
            multAlpha <- bonAlpha
        }
        else if (method == "simes") {
            pvalues.sorted <- sort(pvalues)
            bonAlpha <- alpha/length(pvalues)
            simAlpha <- bonAlpha * 1:length(pvalues)
            imax <- which((pvalues.sorted <= simAlpha) == TRUE)
            if (sum(imax) > 0) {
                imax <- max(imax)
                sigTests <- which((pvalues <= imax * bonAlpha) == 
                  TRUE)
                sigPvalues <- pvalues[sigTests]
                multAlpha <- imax * bonAlpha
            }
        }
        else if (method == "bh") {
            pvalues.sorted <- sort(pvalues)
            kmax <- which((pvalues.sorted <= alpha * (1:length(pvalues))/length(pvalues)) == 
                TRUE)
            if (sum(kmax) > 0) {
                kmax <- max(kmax)
                sigPvalues <- pvalues.sorted[1:kmax]
                multAlpha <- pvalues.sorted[kmax]
                sigTests <- which(is.element(pvalues, sigPvalues))
            }
        }
        else if (method == "csD") {
            alphaGrid <- seq(0, alpha, 0.001)
            csDMat <- matrix(NA, ncol = length(alphaGrid), nrow = 2)
            for (i in 1:length(alphaGrid)) {
                csDMat[1, i] <- sum(pvalues <= alphaGrid[i])
                csDMat[2, i] <- alphaGrid[i] * length(pvalues)
            }
            csD <- csDMat[1, ] - csDMat[2, ]
            multAlpha <- alphaGrid[which(csD == max(csD))]
            sigTests <- which(pvalues <= multAlpha)
            sigPvalues <- pvalues[pvalues <= multAlpha]
        }
        else if (method == "csR") {
            alphaGrid <- seq(0.001, alpha, 0.001)
            csRMat <- matrix(NA, ncol = length(alphaGrid), nrow = 2)
            for (i in 1:length(alphaGrid)) {
                csRMat[1, i] <- sum(pvalues <= alphaGrid[i])
                csRMat[2, i] <- alphaGrid[i] * length(pvalues)
            }
            csR <- csRMat[1, ]/csRMat[2, ]
            multAlpha <- alphaGrid[which(csR == max(csR))]
            sigTests <- which(pvalues <= min(multAlpha))
            sigPvalues <- pvalues[pvalues <= multAlpha]
        }
        result <- list(sigTests = sigTests, sigPvalues = sigPvalues, 
            pvalues = pvalues, method = method, alpha = alpha, 
            multAlpha = multAlpha)
        result
    }
    getSigTests.WY <- function(obs, pm, alpha, alternative, pvalues) {
        Ntests <- length(obs)
        if (alternative == "smaller") {
            obs.sorted <- sort(obs, decreasing = FALSE)
            pm.sorted <- pm[, order(obs, decreasing = FALSE)]
            multAlpha <- c()
            for (i in 1:(Ntests - 1)) {
                temp <- apply(pm.sorted[, (i:Ntests)], 1, min)
                multAlpha[i] <- sum(temp < obs.sorted[i])/nrow(pm)
            }
            multAlpha[Ntests] <- sum(pm.sorted[, Ntests] < obs.sorted[Ntests])/nrow(pm)
            multAlpha <- cummax(multAlpha)[rank(obs)]
        }
        else {
            obs.sorted <- sort(obs, decreasing = TRUE)
            pm.sorted <- pm[, order(obs, decreasing = TRUE)]
            multAlpha <- c()
            for (i in 1:(Ntests - 1)) {
                temp <- apply(pm.sorted[, (i:Ntests)], 1, max)
                multAlpha[i] <- sum(temp > obs.sorted[i])/nrow(pm)
            }
            multAlpha[Ntests] <- sum(pm.sorted[, Ntests] > obs.sorted[Ntests])/nrow(pm)
            multAlpha <- cummax(multAlpha)[rank(-obs)]
        }
        sigTests <- which(multAlpha <= alpha)
        sigPvalues <- pvalues[multAlpha <= alpha]
        names(multAlpha) <- colnames(pvalues)
        result <- list(sigTests = sigTests, sigPvalues = sigPvalues, 
            pvalues = pvalues, method = method, alpha = alpha, 
            multAlpha = multAlpha)
        result
    }
    if (method == "maxT") {
        if (class(pvalues) != "gmw") 
            stop("The pvalues object has to be of class gmw, please put here the outpt of the function gmw.")
        if (attr(pvalues, "keepPM") != TRUE) 
            stop("For the Westfall & Young approach the permutation matrix has to be available, please choose the option 'keepPM=TRUE' in the gmw call.")
        alternative <- attr(pvalues, "alternative")
        if (is.matrix(pvalues$p.values) && nrow(pvalues$p.values) == 
            1) 
            isVector <- TRUE
        if (!isVector) {
            result <- list()
            for (i in 1:nrow(pvalues$p.values)) {
                result[[i]] <- getSigTests.WY(pvalues$obsValue[[i]], 
                  pvalues$nullDist[[i]], alpha = alpha, alternative = alternative, 
                  pvalues = t(as.matrix(pvalues$p.values[i, ])))
            }
            result$inputN <- nrow(pvalues$p.values)
        }
        else {
            result <- getSigTests.WY(pvalues$obsValue[[1]], pvalues$nullDist[[1]], 
                alpha = alpha, alternative = alternative, pvalues = pvalues$p.values)
            result$inputN <- 1
        }
    }
    else {
        if (class(pvalues) != "gmw") {
            temp <- pvalues
            pvalues <- list()
            pvalues$p.values <- temp
        }
        if (is.matrix(pvalues$p.values) && nrow(pvalues$p.values) == 
            1) 
            isVector <- TRUE
        if (!isVector) {
            result <- list()
            for (i in 1:nrow(pvalues$p.values)) {
                result[[i]] <- getSigTests.internal(pvalues$p.values[i, 
                  ], alpha = alpha, method)
            }
            result$inputN <- nrow(pvalues$p.values)
        }
        else {
            result <- getSigTests.internal(pvalues$p.values, 
                alpha, method)
            result$inputN <- 1
        }
    }
    class(result) <- "re"
    result
}
<bytecode: 0x3e68258>
<environment: namespace:gMWT>
 --- function search by body ---
Function getSigTests in namespace gMWT has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1