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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: FADA
> ### Title: Factor Adjusted Discriminant Analysis 3-4 : Supervised
> ###   classification on decorrelated data
> ### Aliases: FADA
> 
> ### ** Examples
> 
> data(data.train)
> data(data.test)
> 
> # When testing data set is provided
> res = decorrelate.train(data.train)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
FADA
 --- call from context --- 
ifa(Psi, B)
 --- call from argument --- 
if (class(B) == "numeric") B = matrix(B, ncol = 1)
 --- R stacktrace ---
where 1: ifa(Psi, B)
where 2: FUN(X[[i]], ...)
where 3: lapply(1:maxnbfactors, emfa.nbf, csdata = csdata, S = S, eig = eig, 
    vy = vy, minerr = minerr, EM = EM, verbose = FALSE)
where 4: nbfactors(scale(cdta, center = FALSE, scale = TRUE), maxnbfactors = maxnbfactors, 
    EM = EM, diagnostic.plot = diagnostic.plot, jumps.nbfactor = 0.05)
where 5: decorrelate.train(data.train)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (Psi, B) 
{
    if (class(B) == "numeric") 
        B = matrix(B, ncol = 1)
    q = ncol(B)
    Phi = rep(0, length(Psi))
    Phi[abs(Psi) > 1e-05] = 1/Psi[abs(Psi) > 1e-05]
    PhiB = tcrossprod(Phi, rep(1, q))
    PhiB = PhiB * B
    G = diag(q) + t(B) %*% PhiB
    GinvtPhiB = tcrossprod(solve(G), PhiB)
    Phib2 = tcrossprod(PhiB, t(GinvtPhiB))
    iS = diag(Phi) - Phib2
    PhiB2 = crossprod(PhiB, B)
    GinvtPhiB2 = crossprod(solve(G), PhiB2)
    Phib2 = tcrossprod(PhiB, t(GinvtPhiB2))
    iSB = PhiB - Phib2
    return(list(iS = iS, iSB = iSB))
}
<bytecode: 0xc1bac90>
<environment: namespace:FADA>
 --- function search by body ---
Function ifa in namespace FADA has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(B) == "numeric") B = matrix(B, ncol = 1) : 
  the condition has length > 1
Calls: decorrelate.train -> nbfactors -> lapply -> FUN -> ifa
Execution halted