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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: res_cal
> ### Title: Linear Regression Residuals Calculation
> ### Aliases: res_cal
> 
> ### ** Examples
> 
> # Generating random data
> set.seed(1)
> n <- 100
> H <- 5
> y <- matrix(rnorm(2*n), nrow = n)
> x <- matrix(rnorm(10*n), nrow = n)
> by <- letters[sample(1:H, n, replace = TRUE)]
> 
> # Direct calculation
> res_cal(y, x)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
gustave
 --- call from context --- 
res_cal(y, x)
 --- call from argument --- 
if (class(e) != class_y) e <- methods::as(e, class_y)
 --- R stacktrace ---
where 1: res_cal(y, x)

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (y = NULL, x, w = NULL, by = NULL, precalc = NULL, id = NULL) 
{
    if (is.null(precalc)) {
        if (is.null(w)) 
            w <- rep(1, NROW(x))
        x <- coerce_to_TsparseMatrix(x)
        if (!is.null(by)) 
            x <- detect_block(x, by) %||% make_block(x, by)
        while (TRUE) {
            u <- crossprod(x, Matrix::Diagonal(x = w) %*% x)
            if (Matrix::rankMatrix(u, method = "qr") != NROW(u)) {
                is_colinear <- as.vector(is.na(stats::lm.fit(x = as.matrix(u), 
                  y = rep(1, NROW(u)))$coef))
                if (any(is_colinear)) 
                  note("Some variables in x were discarded due to collinearity.")
                x <- x[, !is_colinear, drop = FALSE]
            }
            else break
        }
        inv <- solve(u)
    }
    else list2env(precalc, envir = environment())
    if (is.null(y)) 
        return(list(x = x, w = w, inv = inv))
    else {
        class_y <- class(y)
        dimnames_y <- dimnames(y)
        y <- coerce_to_TsparseMatrix(y)
        if (!is.null(precalc) && !is.null(id) && !is.null(rownames(y)) && 
            !identical(as.character(id), rownames(y))) 
            stop("The names of the data matrix (y argument) do not match the reference id (id argument).")
        e <- y - x %*% (inv %*% crossprod(x, Matrix::Diagonal(x = w) %*% 
            y))
        if (class(e) != class_y) 
            e <- methods::as(e, class_y)
        dimnames(e) <- dimnames_y
        e
    }
}
<bytecode: 0x55c117f0fa18>
<environment: namespace:gustave>
 --- function search by body ---
Function res_cal in namespace gustave has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1