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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: CVknn
> ### Title: Cross-validation for K nearest-neighbor regression
> ### Aliases: CVknn
> 
> ### ** Examples
> 
> data(EOC)
> XX <- cbind(EOC$CA125, EOC$CA153, EOC$Age)
> Dna <- preDATA(EOC$D, EOC$CA125)
There are missing disease status.
The sample means of diagostic test based on three classes.
( 1 ) 1 : 0.555 
( 2 ) 2 : 2.112 
( 3 ) 3 : 3.347 
The sample median of diagostic test based on three classes.
( 1 ) 1 : 0.286 
( 2 ) 2 : 1.972 
( 3 ) 3 : 3.439 
The ordering based on median: 1 < 2 < 3  
> Dvec.na <- Dna$Dvec
> CVknn(XX, Dvec.na, EOC$V, type = "mahala", plot = TRUE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
bcROCsurface
 --- call from context --- 
CVknn(XX, Dvec.na, EOC$V, type = "mahala", plot = TRUE)
 --- call from argument --- 
if (class(X) != "matrix") stop("\"XX\" not a matrix \n")
 --- R stacktrace ---
where 1: CVknn(XX, Dvec.na, EOC$V, type = "mahala", plot = TRUE)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (X, Dvec, V, K.list = NULL, type = "eucli", plot = FALSE) 
{
    if (class(X) != "matrix") 
        stop("\"XX\" not a matrix \n")
    if (class(Dvec) != "matrix" | ncol(Dvec) != 3 | !all(is.element(na.omit(Dvec), 
        c(0, 1)))) 
        stop("variable \"Dvec\" must be a binary matrix with 3 columns")
    if (nrow(X) != nrow(Dvec)) 
        stop(gettextf("arguments imply differing number of observation: %d", 
            nrow(X)), gettextf(", %d", nrow(Dvec)), domain = NA)
    if (missing(V)) 
        stop("object \"V\" is missing \n")
    x.ver <- X[V == 1, ]
    y.ver <- Dvec[V == 1, ]
    n.ver <- nrow(x.ver)
    if (!is.null(K.list)) {
        if (length(K.list) >= n.ver) 
            stop("k needs to less than n.ver - 1 !! \n")
        else kk <- K.list
    }
    else kk <- seq(1, ceiling(n.ver/2))
    nkk <- length(kk)
    cv_cri <- numeric(nkk)
    rho.ver <- rhoKNN(x.ver, y.ver, rep(1, n.ver), K = kk, type = type)
    for (i in 1:nkk) {
        cv_cri[i] <- sum(colSums(abs(y.ver[, -3] - rho.ver[[i]]$values[, 
            -3])))
    }
    cv_cri <- cv_cri/(n.ver * (ncol(Dvec) - 1))
    ans <- which.min(cv_cri)
    name.type <- switch(type, eucli = "Euclidean", manha = "Manhattan", 
        canber = "Canberra", lagran = "Lagrange", mahala = "Mahalanobis")
    if (plot) {
        plot(1/kk, cv_cri, type = "b", xlab = "1/K", ylab = "The discrepancy", 
            main = paste("The CV of KNN regression with", name.type, 
                "Distance"))
        points(1/ans, min(cv_cri), pch = 16)
        grid()
        legend("topright", "The good choice for K", pch = 16, 
            cex = 0.7)
    }
    return(ans)
}
<bytecode: 0x210f430>
<environment: namespace:bcROCsurface>
 --- function search by body ---
Function CVknn in namespace bcROCsurface has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) != "matrix") stop("\"XX\" not a matrix \n") : 
  the condition has length > 1
Calls: CVknn
Execution halted