Running examples in ‘grpss-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: grpss
> ### Title: Group screening and selection
> ### Aliases: grpss grpss.default grpss.formula
> 
> ### ** Examples
> 
> library(MASS)
> set.seed(23)
> n <- 30 # sample size
> p <- 3  # number of predictors in each group
> J <- 50  # group size
> group <- rep(1:J,each = 3)  # group indices
> ##autoregressive correlation
> Sigma <- 0.6^abs(matrix(1:(p*J),p*J,p*J) - t(matrix(1:(p*J),p*J,p*J)))
> X <- mvrnorm(n,seq(0,5,length.out = p*J),Sigma)
> betaTrue <- runif(12,-2,5)
> mu <- X%*%matrix(c(betaTrue,rep(0,p*J-12)),ncol = 1)
> 
> # normal distribution
> y <- mu + rnorm(n)
> 
> # only conduct screening procedure
> (gss01 <- grpss(X,y,group)) # gSIS
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
grpss
 --- call from context --- 
grpss.default(X, y, group)
 --- call from argument --- 
if (class(X) != "matrix") {
    tempX <- try(X <- as.matrix(X), silent = TRUE)
    if (class(tempX)[1] == "try-error") 
        stop("'X' must be a matrix or can be coerced to a matrix")
}
 --- R stacktrace ---
where 1: grpss.default(X, y, group)
where 2: grpss(X, y, group)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (X, y, group, threshold = NULL, scale = c("standardize", 
    "normalize", "none"), criterion = c("gSIS", "gHOLP", "gAR2", 
    "gDC"), family = c("gaussian", "binomial", "poisson"), select = FALSE, 
    penalty = c("grSCAD", "grLasso", "grMCP", "gel", "cMCP"), 
    cross.validation = FALSE, norm = c("L1", "L2", "Linf"), q = 1, 
    perm.seed = 1, nfolds = 10, cv.seed = NULL, parallel = FALSE, 
    cl = NULL, cores = NULL, ...) 
{
    if (class(X) != "matrix") {
        tempX <- try(X <- as.matrix(X), silent = TRUE)
        if (class(tempX)[1] == "try-error") 
            stop("'X' must be a matrix or can be coerced to a matrix")
    }
    if (!is.numeric(y)) 
        stop("'y' must be a numeric vector or a matrix")
    if (parallel) 
        registerDoParallel(cl = ifelse(is.null(cl), 3, cl), cores)
    type <- match.arg(scale)
    criterion <- match.arg(criterion)
    family <- match.arg(family)
    penalty <- match.arg(penalty)
    norm <- match.arg(norm)
    ok <- complete.cases(X, y)
    if (sum(!ok) > 0) 
        warning("Missing values exist and have been removed")
    X <- X[ok, ]
    y <- y[ok]
    if (length(group) != ncol(X)) 
        stop("length of group must be equal to ncol(X)")
    if (is.null(colnames(X))) 
        colnames(X) <- paste0("X", group)
    X0 <- g0 <- NULL
    if (any(group == 0)) {
        grp0 <- group == 0
        X0 <- X[, grp0]
        X <- X[, !grp0]
        g0 <- group[grp0]
        group <- group[!grp0]
    }
    X <- XX <- X[, order(group)]
    group <- sort(as.numeric(as.factor(group)))
    grp.values <- grp.criValues(X, y, group, criterion, family, 
        type, norm)
    grp.index <- grp.values[order(grp.values[, 2], decreasing = TRUE), 
        ]
    if (is.null(threshold)) {
        set.seed(perm.seed)
        grp.values0 <- grp.criValues(X[sample(nrow(X)), ], y, 
            group, criterion, family, type, norm)[, 2]
        set.seed(NULL)
        thres <- grp.index[, 2] > as.numeric(quantile(grp.values0, 
            q))
        threshold <- as.integer(sum(thres))
        if (threshold == 0 || threshold == max(group)) 
            threshold <- as.integer(length(y)/log(length(y)))
    }
    grp.select <- sort(grp.index[1:threshold, 1])
    X <- cbind(X0, XX[, group %in% grp.select])
    if (!select) {
        result <- list(call = match.call(), y = y, X = X, group.screen = c(unique(g0), 
            grp.select), threshold = threshold, criterion = criterion)
        class(result) <- "grpss"
    }
    else {
        grp0 <- table(group[group %in% grp.select])
        group <- rep(1:length(grp0), times = grp0)
        if (cross.validation) {
            if (!is.null(cv.seed)) 
                set.seed(cv.seed)
            grpfit <- cv.grpreg(X, y, group, family = family, 
                penalty = penalty, nfolds = nfolds, ...)
        }
        else {
            grpfit <- grpreg(X, y, group, penalty, family, ...)
        }
        result <- c(list(call = match.call(), group.screen = c(g0, 
            grp.select), criterion = criterion), grpfit)
        class(result) <- if (cross.validation) 
            "cv.grpreg"
        else "grpreg"
    }
    return(result)
}
<bytecode: 0x5569cf46c5c0>
<environment: namespace:grpss>
 --- function search by body ---
Function grpss.default in namespace grpss has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) != "matrix") { : the condition has length > 1
Calls: grpss -> grpss.default
Execution halted