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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: TVbo
> ### Title: TV dataset
> ### Aliases: TVbo
> ### Keywords: datasets
> 
> ### ** Examples
> 
> ## import SensMixed package
> library(SensMixed)
> 
> ## convert some variables to factors in TVbo
> TVbo <- convertToFactors(TVbo, c("Assessor", "Repeat", "Picture"))
> 
> ## run automated selection process
> res <- sensmixed(c("Coloursaturation", "Colourbalance"),
+ prod_effects = c("TVset", "Picture"), 
+ assessor="Assessor", data=TVbo, MAM=FALSE)

  |                                                                            
  |                                                                      |   0%Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.00592903 (tol = 0.002, component 1)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
SensMixed
 --- call from context --- 
calcSatterthMultDF(rho, L)
 --- call from argument --- 
if (class(g) == "numeric") {
    lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
} else {
    lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
}
 --- R stacktrace ---
where 1: calcSatterthMultDF(rho, L)
where 2: calcSatt(rho, Lc)
where 3: calcFpvalueSS(Lc, rho, ddf, type)
where 4: calcFpvalueMAIN(term = tt, L = L, rho = rho, ddf = ddf, type = type)
where 5: FUN(X[[i]], ...)
where 6: lapply(test.terms, function(tt) calcFpvalueMAIN(term = tt, L = L, 
    rho = rho, ddf = ddf, type = type))
where 7: stepFun(model = model, ddf = ddf, type = type, alpha.random = alpha.random, 
    alpha.fixed = alpha.fixed, reduce.fixed = reduce.fixed, reduce.random = reduce.random, 
    fixed.calc = fixed.calc, lsmeans.calc = lsmeans.calc, difflsmeans.calc = difflsmeans.calc, 
    test.effs = test.effs, keep.effs = keep.effs, change.contr = TRUE)
where 8: step(m, reduce.fixed = FALSE, reduce.random = reduce.random, 
    alpha.random = alpha.random, alpha.fixed = alpha.fixed, lsmeans.calc = TRUE, 
    difflsmeans.calc = calc_post_hoc, keep.effs = keep.effs)
where 9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
where 10: suppressMessages(st <- step(m, reduce.fixed = FALSE, reduce.random = reduce.random, 
    alpha.random = alpha.random, alpha.fixed = alpha.fixed, lsmeans.calc = TRUE, 
    difflsmeans.calc = calc_post_hoc, keep.effs = keep.effs))
where 11: .fun(piece, ...)
where 12: (function (i) 
{
    piece <- pieces[[i]]
    if (.inform) {
        res <- try(.fun(piece, ...))
        if (inherits(res, "try-error")) {
            piece <- paste(utils::capture.output(print(piece)), 
                collapse = "\n")
            stop("with piece ", i, ": \n", piece, call. = FALSE)
        }
    }
    else {
        res <- .fun(piece, ...)
    }
    progress$step()
    res
})(1L)
where 13: loop_apply(n, do.ply)
where 14: llply(attributes, .stepAllAttrNoMAM, product_structure = product_structure, 
    error_structure = error_structure, data = data, prod_effects = prod_effects, 
    random = random, reduce.random = rmatch(control, "reduce.random"), 
    alpha.random = rmatch(control, "alpha.random"), alpha.fixed = rmatch(control, 
        "alpha.fixed"), calc_post_hoc = rmatch(control, "calc_post_hoc"), 
    keep.effs = keep.effs, .progress = "text")
where 15: sensmixedFun(attributes = attributes, prod_effects = prod_effects, 
    assessor = assessor, replication = replication, data = data, 
    product_structure = product_structure, error_structure = error_structure, 
    MAM = MAM, control = control)
where 16: sensmixed(c("Coloursaturation", "Colourbalance"), prod_effects = c("TVset", 
    "Picture"), assessor = "Assessor", data = TVbo, MAM = FALSE)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (rho, Lc) 
{
    vcov.final <- as.matrix(vcov(rho$model))
    if (is.vector(Lc)) 
        C.theta.optim <- as.matrix(t(Lc) %*% vcov.final %*% Lc)
    else C.theta.optim <- as.matrix(Lc %*% vcov.final %*% t(Lc))
    invC.theta <- tryCatch({
        solve(C.theta.optim)
    }, error = function(e) {
        NULL
    })
    if (is.null(invC.theta)) 
        return(list(denom = 0, Fstat = NA, pvalue = NA, ndf = NA, 
            ss = NA, ms = NA))
    q <- qr(C.theta.optim)$rank
    F.stat <- (t(Lc %*% rho$fixEffs) %*% invC.theta %*% (Lc %*% 
        rho$fixEffs))/q
    svdec <- eigen(C.theta.optim)
    PL <- t(svdec$vectors) %*% Lc
    vss2 <- vcovTheta(rho$model)
    theopt <- c(rho$thopt, rho$sigma)
    g <- mygrad(function(x) vss2(x), theopt)
    mat.grad <- if (class(g) == "numeric") {
        lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
    }
    else {
        lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
    }
    nu.m.fun <- function(m) {
        den.nu <- unlist(lapply(1:length(mat.grad), function(i) as.matrix(t(PL[m, 
            ]) %*% mat.grad[[i]] %*% PL[m, ])))
        2 * (svdec$values[m])^2/(t(den.nu) %*% rho$A %*% den.nu)
    }
    nu.m <- unlist(lapply(1:length(svdec$values), nu.m.fun))
    nu.m[which(abs(2 - nu.m) < 1e-05)] <- 2.00001
    E <- sum((nu.m/(nu.m - 2)) * as.numeric(nu.m > 2))
    nu.F <- 2 * E * as.numeric(E > q)/(E - q)
    pvalueF <- pf(F.stat, qr(Lc)$rank, nu.F, lower.tail = FALSE)
    if (is.na(F.stat)) 
        ms <- ss <- NA
    else {
        ms <- F.stat * rho$sigma^2
        ss <- ms * q
    }
    return(list(ss = ss, ms = ms, denom = nu.F, Fstat = F.stat, 
        pvalue = pvalueF, ndf = q))
}
<bytecode: 0x562e1370a090>
<environment: namespace:SensMixed>
 --- function search by body ---
Function calcSatterthMultDF in namespace SensMixed has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1