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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: cv.grpregOverlap
> ### Title: Cross-validation for choosing regularization parameter lambda
> ### Aliases: cv.grpregOverlap
> 
> ### ** Examples
> 
> ## linear regression, a simulation demo.
> set.seed(123)
> group <- list(gr1 = c(1, 2, 3),
+               gr2 = c(1, 4),
+               gr3 = c(2, 4, 5),
+               gr4 = c(3, 5),
+               gr5 = c(6))
> beta.latent.T <- c(5, 5, 5, 0, 0, 0, 0, 0, 5, 5, 0) # true latent coefficients.
> # beta.T <- c(5, 5, 10, 0, 5, 0), true variables: 1, 2, 3, 5; true groups: 1, 4.
> X <- matrix(rnorm(n = 6*100), ncol = 6)
> X.latent <- expandX(X, group)
> y <- X.latent %*% beta.latent.T + rnorm(100)
> 
> cvfit <- cv.grpregOverlap(X, y, group, penalty = 'grMCP')
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
grpregOverlap
 --- call from context --- 
grpregOverlap(X = X, y = y, group = group, returnX = TRUE, ...)
 --- call from argument --- 
if (class(X) != "matrix") {
    tmp <- try(X <- as.matrix(X), silent = TRUE)
    if (class(tmp)[1] == "try-error") {
        stop("X must be a matrix or able to be coerced to a matrix")
    }
}
 --- R stacktrace ---
where 1: grpregOverlap(X = X, y = y, group = group, returnX = TRUE, ...)
where 2: cv.grpregOverlap(X, y, group, penalty = "grMCP")

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (X, y, group, penalty = c("grLasso", "grMCP", "grSCAD", 
    "gel", "cMCP", "gLasso", "gMCP"), family = c("gaussian", 
    "binomial", "poisson", "cox"), nlambda = 100, lambda, lambda.min = {
    if (nrow(X) > ncol(X)) 
        1e-04
    else 0.05
}, alpha = 1, eps = 0.001, max.iter = 1000, dfmax = ncol(X), 
    gmax = length(group), gamma = ifelse(penalty == "grSCAD", 
        4, 3), tau = 1/3, group.multiplier, returnX = FALSE, 
    returnOverlap = FALSE, warn = TRUE, ...) 
{
    if (class(X) != "matrix") {
        tmp <- try(X <- as.matrix(X), silent = TRUE)
        if (class(tmp)[1] == "try-error") {
            stop("X must be a matrix or able to be coerced to a matrix")
        }
    }
    if (storage.mode(X) == "integer") 
        X <- 1 * X
    incid.mat <- incidenceMatrix(X, group)
    over.mat <- over.temp <- Matrix(incid.mat %*% t(incid.mat))
    grp.vec <- rep(1:nrow(over.mat), times = diag(over.mat))
    X.latent <- expandX(X, group)
    diag(over.temp) <- 0
    if (all(over.temp == 0)) {
        cat("Note: There are NO overlaps between groups at all!", 
            "\n")
        cat("      Now conducting non-overlapping group selection ...")
    }
    gs <- diag(over.mat)
    gs <- gs[gs != 0]
    penalty <- match.arg(penalty)
    if (missing(group.multiplier)) {
        if (strtrim(penalty, 2) == "gr") {
            group.multiplier <- sqrt(gs)
        }
        else {
            group.multiplier <- rep(1, length(group))
        }
    }
    family <- match.arg(family)
    if (family != "cox") {
        fit <- grpreg(X = X.latent, y = y, group = grp.vec, penalty = penalty, 
            family = family, nlambda = nlambda, lambda = lambda, 
            lambda.min = lambda.min, alpha = alpha, eps = eps, 
            max.iter = max.iter, dfmax = dfmax, gmax = gmax, 
            gamma = gamma, tau = tau, group.multiplier = group.multiplier, 
            warn = warn, ...)
    }
    else {
        fit <- grpsurv(X = X.latent, y = y, group = grp.vec, 
            penalty = penalty, gamma = gamma, alpha = alpha, 
            nlambda = nlambda, lambda = lambda, lambda.min = lambda.min, 
            eps = eps, max.iter = max.iter, dfmax = dfmax, gmax = gmax, 
            tau = tau, group.multiplier = group.multiplier, warn = warn, 
            ...)
    }
    fit$beta.latent <- fit$beta
    fit$beta <- gamma2beta(gamma = fit$beta, incid.mat, grp.vec, 
        family = family)
    fit$incidence.mat <- incid.mat
    fit$group <- group
    fit$grp.vec <- grp.vec
    fit$family <- family
    if (returnX) {
        fit$X.latent <- X.latent
    }
    if (returnOverlap) {
        fit$overlap.mat <- over.mat
    }
    if (family != "cox") {
        val <- structure(fit, class = c("grpregOverlap", "grpreg"))
    }
    else {
        val <- structure(fit, class = c("grpsurvOverlap", "grpregOverlap"))
    }
    val
}
<bytecode: 0xba59218>
<environment: namespace:grpregOverlap>
 --- function search by body ---
Function grpregOverlap in namespace grpregOverlap has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) != "matrix") { : the condition has length > 1
Calls: cv.grpregOverlap -> grpregOverlap
Execution halted