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

> ### Name: bridge
> ### Title: Fit a Bridge Estimation
> ### Aliases: bridge
> 
> ### ** Examples
> 
> set.seed(2019) 
> beta <- c(3, 1.5, 0, 0, 2, 0, 0, 0)
> p <- length(beta)
> beta <- matrix(beta, nrow = p, ncol = 1)
> 
> n = 100
> X = matrix(rnorm(n*p),n,p)
> y = X%*%beta + rnorm(n) 
> 
> model1 <- bridge(X, y, q = 1)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
rbridge
 --- call from context --- 
bridge(X, y, q = 1)
 --- call from argument --- 
if (class(X) != "matrix") {
    tmp <- try(X <- model.matrix(~0 + ., data = 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: bridge(X, y, q = 1)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (X, y, q = 1, lambda.min = ifelse(n > p, 0.001, 0.05), 
    nlambda = 100, lambda, eta = 1e-07, converge = 10^10) 
{
    if (class(X) != "matrix") {
        tmp <- try(X <- model.matrix(~0 + ., data = 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") 
        storage.mode(X) <- "double"
    if (class(y) != "numeric") {
        tmp <- try(y <- as.numeric(y), silent = TRUE)
        if (class(tmp)[1] == "try-error") 
            stop("y must numeric or able to be coerced to numeric")
    }
    if (nlambda < 2) 
        stop("nlambda must be at least 2")
    if (q > 2) 
        stop("a must be less than 2; choose a small positive number instead")
    if (any(is.na(y)) | any(is.na(X))) 
        stop("Missing data (NA's) detected.  Take actions (e.g., removing cases, removing features, imputation) to eliminate missing data before passing X and y to ncvreg")
    if (length(y) != nrow(X)) 
        stop("X and y do not have the same number of observations")
    stdX <- standard(X)
    XX <- stdX$xx
    p <- ncol(XX)
    ns <- c(1:p)
    yy <- y - mean(y)
    n <- length(yy)
    if (missing(lambda)) {
        lambda <- Lambdas_Grid(XX, yy, q, lambda.min, nlambda)
        user.lambda <- FALSE
    }
    else {
        nlambda <- length(lambda)
        user.lambda <- TRUE
    }
    fit <- Bridge(XX, yy, q, lambda, converge, eta)
    constant <- rep(mean(y), nlambda)
    betas <- matrix(fit, p, nlambda)
    unbetas <- matrix(0, nrow = (ncol(X) + 1), ncol = length(lambda))
    bbetas <- betas/as.vector(stdX$s)
    unbetas[ns + 1, ] <- bbetas
    unbetas[1, ] <- constant - crossprod(as.vector(stdX$c), bbetas)
    varnames <- if (is.null(colnames(X))) 
        paste("V", 1:ncol(X), sep = "")
    else colnames(X)
    varnames <- c("(Intercept)", varnames)
    dimnames(unbetas) <- list(varnames, lambda)
    output <- structure(list(betas = unbetas, lambda = lambda), 
        class = "bridge")
    output
}
<bytecode: 0xa3bd810>
<environment: namespace:rbridge>
 --- function search by body ---
Function bridge in namespace rbridge has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) != "matrix") { : the condition has length > 1
Calls: bridge
Execution halted