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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: predict.rncReg
> ### Title: make predictions from a "rncReg" object.
> ### Aliases: predict.rncReg
> ### Keywords: models networks regression
> 
> ### ** Examples
> 
> set.seed(100)
> 
> A <- matrix(0,200,200)
> A[1:100,1:100] <- 1
> A[101:200,101:200] <- 1
> diag(A) <- 0
> 
> alpha <- c(rep(1,100),rep(-1,100)) + rnorm(200)*0.5
> A <- A[c(1:50,101:150,51:100,151:200),c(1:50,101:150,51:100,151:200)]
> alpha <- alpha[c(1:50,101:150,51:100,151:200)]
> 
> beta <- rnorm(2)
> 
> X <- matrix(rnorm(400),ncol=2)
> 
> Y <- X
> 
> A1 <- A[1:100,1:100]
> X1 <- X[1:100,]
> Y1 <- matrix(Y[1:100],ncol=1)
> 
> 
> ## If one wants to regularize the Laplacian by 
> ## using gamma > 0 in rncreg, we suggest use 
> ## centered data.
> #mean.x <- colMeans(X1)
> #mean.y <- mean(Y1)
> #Y1 <- Y1-mean.y
> #X1 <- t(t(X1)-mean.x)
> #Y <- Y-mean.y
> #X <- t(t(X)-mean.x)
> 
> 
> 
> m <- rncreg(A=A1,X=X1,Y=Y1,model="linear",lambda=10,gamma=0,cv=5)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
netcoh
 --- call from context --- 
rncreg(A = A1, X = X1, Y = Y1, model = "linear", lambda = 10, 
    gamma = 0, cv = 5)
 --- call from argument --- 
if (class(X) != "matrix") stop("X should be a matrix!")
 --- R stacktrace ---
where 1: rncreg(A = A1, X = X1, Y = Y1, model = "linear", lambda = 10, 
    gamma = 0, cv = 5)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (A, lambda, Y = NULL, X = NULL, dt = NULL, gamma = 0.05, 
    model = c("linear", "logistic", "cox"), max.iter = 50, tol = 1e-04, 
    init = NULL, cv = NULL, cv.seed = 999, low.dim = NULL, verbose = FALSE) 
{
    if (length(model) > 1) 
        model <- model[1]
    if (!any(c("linear", "logistic", "cox") == model)) 
        stop("model must be one of linear, logistic and cox.")
    n <- nrow(A)
    if (norm(t(A) - A, "F") > 0) 
        warning("A is not symmetric....")
    if (!is.null(X)) {
        if (class(X) != "matrix") 
            stop("X should be a matrix!")
        if (nrow(X) != n) 
            stop("Dimensions do not match!")
    }
    if (!is.null(Y)) {
        if (class(Y) != "matrix") 
            stop("Y should be a matrix!")
        if (nrow(Y) != n) 
            stop("Dimensions do not match!")
    }
    if (!is.null(dt)) {
        if (nrow(dt) != n) 
            stop("Dimensions do not match!")
        if (class(dt) != "data.frame") 
            stop("dt must be a data.frame!")
    }
    if (model == "linear") {
        result <- rnc.linear(X = X, Y = Y, A = A, lambda = lambda, 
            gamma = gamma, cv = cv, cv.seed = cv.seed, low.dim = low.dim)
        result.obj <- list(alpha = result$alpha, beta = result$beta, 
            A = A, lambda = lambda, X = X, Y = Y, dt = dt, gamma = gamma, 
            cv = cv, cv.loss = result$cv.MSE, cv.sd = result$cv.sd, 
            model = model)
        class(result.obj) <- "rncReg"
        return(result.obj)
    }
    if (model == "logistic") {
        result <- rnc.logistic(X = X, Y = Y, A = A, lambda = lambda, 
            gamma = gamma, cv = cv, cv.seed = cv.seed, max.iter = max.iter, 
            tol = tol, init = init, verbose = verbose)
        result.obj <- list(alpha = result$alpha, beta = result$beta, 
            A = A, lambda = lambda, X = X, Y = Y, dt = dt, gamma = gamma, 
            cv = cv, cv.loss = result$cv.dev, cv.sd = result$cv.sd, 
            model = model)
        class(result.obj) <- "rncReg"
        return(result.obj)
    }
    if (model == "cox") {
        result <- rnc.cox(X = X, dt = dt, A = A, lambda = lambda, 
            gamma = gamma, cv = cv, cv.seed = cv.seed, max.iter = max.iter, 
            tol = tol, init = init, verbose = verbose)
        result.obj <- list(alpha = result$alpha, beta = result$beta, 
            A = A, lambda = lambda, X = X, Y = Y, dt = dt, gamma = gamma, 
            cv = cv, cv.loss = result$cv.dev, cv.sd = result$cv.sd, 
            model = model)
        class(result.obj) <- "rncReg"
        return(result.obj)
    }
}
<bytecode: 0xbe8eb88>
<environment: namespace:netcoh>
 --- function search by body ---
Function rncreg in namespace netcoh has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) != "matrix") stop("X should be a matrix!") : 
  the condition has length > 1
Calls: rncreg
Execution halted