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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: mbmgPCA
> ### Title: multiblock and multigroup Principal Component Analysis
> ### Aliases: mbmgPCA
> 
> ### ** Examples
> 
> data(wine)
> Select=c(which(wine[,2]=="Env1"),which(wine[,2]=="Env2"),which(wine[,2]=="Reference"))
> WineData = wine[Select,-c(1,2)]
> Group <- as.factor(c(rep("Env1",7), rep("Env2",5), rep("Reference",7)))
> nBlock <- c(5, 3, 10, 9)
> BlockNames    <- c("Olfaction at rest", "Vision", "Olfaction  after shaking", "Taste")
> res = mbmgPCA(Data = WineData, Group, nBlock , ncomp=5)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
multigroup
 --- call from context --- 
transfer_Group(K.Data[[k]], Group)
 --- call from argument --- 
if (class(Data) == "data.frame") {
    Data = as.matrix(Data)
}
 --- R stacktrace ---
where 1: transfer_Group(K.Data[[k]], Group)
where 2: prepare_data(Data, Group, nBlock, Block.name, ScaleGroup, ScaleDataA, 
    ScaleDataB, norm)
where 3: mbmgPCA(Data = WineData, Group, nBlock, ncomp = 5)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (Data, Group) 
{
    if (class(Data) == "data.frame") {
        Data = as.matrix(Data)
    }
    rownames(Data) = Group
    M = length(levels(Group))
    P = dim(Data)[2]
    n = as.vector(table(Group))
    N = sum(n)
    Data.group = list()
    Xm = split(Data, Group)
    grouprname = split(rownames(Data), Group)
    for (m in 1:M) {
        if (class(Xm[[m]]) != "data.frame") {
            Xm[[m]] = matrix(Xm[[m]], ncol = P)
        }
        colnames(Xm[[m]]) = colnames(Data)
        rownames(Xm[[m]]) = grouprname[[m]]
    }
    Data.group = Xm
    return(Data.group)
}
<bytecode: 0x2bd7e28>
<environment: namespace:multigroup>
 --- function search by body ---
Function transfer_Group in namespace multigroup has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(Data) == "data.frame") { : 
  the condition has length > 1
Calls: mbmgPCA -> prepare_data -> transfer_Group
Execution halted