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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: coef.tandem
> ### Title: Returns the regression coefficients from a TANDEM fit
> ### Aliases: coef.tandem
> 
> ### ** Examples
> 
> # unpack example data
> x = example_data$x
> y = example_data$y
> upstream = example_data$upstream
> 
> # fit a tandem model, determine the coefficients and create a prediction
> fit = tandem(x, y, upstream, alpha=0.5)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
TANDEM
 --- call from context --- 
tandem(x, y, upstream, alpha = 0.5)
 --- call from argument --- 
if (class(x) != "matrix" | !class(x[1, 1]) %in% c("numeric", 
    "integer")) stop("x needs to be a numeric matrix")
 --- R stacktrace ---
where 1: tandem(x, y, upstream, alpha = 0.5)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (x, y, upstream, family = "gaussian", nfolds = 10, foldid = NULL, 
    lambda_upstream = "lambda.1se", lambda_downstream = "lambda.1se", 
    ...) 
{
    if (class(x) != "matrix" | !class(x[1, 1]) %in% c("numeric", 
        "integer")) 
        stop("x needs to be a numeric matrix")
    if (!class(y) %in% c("numeric", "integer")) 
        stop("y needs to be a numeric vector")
    if (class(upstream) != "logical") 
        stop("upstream needs to a logical index vector, integer index vectors are currently not supported")
    if (nrow(x) != length(y)) 
        stop("Number of samples in x and y don't match")
    if (ncol(x) != length(upstream)) 
        stop("Number of features in x and upstream don't match")
    if (family != "gaussian") 
        stop("Currently only the glmnet family='guassian' is supported")
    if (any(is.na(x))) 
        stop("NAs in x are not allowed")
    if (any(is.na(y))) 
        stop("NAs in y are not allowed")
    if (nrow(x) < nfolds) 
        stop("nfolds should be smaller than the number of samples")
    if (!lambda_upstream %in% c("lambda.1se", "lambda.min")) 
        stop("lambda_upstream should be either lambda.1se or lambda.min")
    if (!lambda_downstream %in% c("lambda.1se", "lambda.min")) 
        stop("lambda_downstream should be either lambda.1se or lambda.min")
    if (is.null(foldid)) {
        n = length(y)
        foldid = ceiling(sample(1:n)/n * nfolds)
    }
    fit1 = glmnet::cv.glmnet(x[, upstream], y, foldid = foldid, 
        ...)
    residuals = y - glmnet::predict.cv.glmnet(fit1, newx = x[, 
        upstream], s = lambda_upstream)
    fit2 = glmnet::cv.glmnet(x[, !upstream], residuals, foldid = foldid, 
        ...)
    beta0 = glmnet::coef.cv.glmnet(fit1, s = lambda_upstream)[1] + 
        glmnet::coef.cv.glmnet(fit2, s = lambda_downstream)[1]
    beta = matrix(NA, ncol(x), 1)
    beta[upstream, ] = as.matrix(glmnet::coef.cv.glmnet(fit1, 
        s = lambda_upstream)[-1, , drop = F])
    beta[!upstream, ] = as.matrix(glmnet::coef.cv.glmnet(fit2, 
        s = lambda_downstream)[-1, , drop = F])
    rownames(beta) = colnames(x)
    beta = Matrix::Matrix(beta)
    fit = list(beta0 = beta0, beta = beta)
    class(fit) = "tandem"
    return(fit)
}
<bytecode: 0x194fe60>
<environment: namespace:TANDEM>
 --- function search by body ---
Function tandem in namespace TANDEM has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1