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

> ### Name: MetaSKAT_wZ
> ### Title: Meta analysis SKAT with individual level genotype data
> ### Aliases: MetaSKAT_wZ
> 
> ### ** Examples
> 
> 
> 
> data(Example)
> attach(Example)
> 
> #############################################################
> #	Compute a p-value of the first gene
> 
> obj<-Meta_Null_Model(y.list, x.list, n.cohort=3, out_type="D")
> 
> # rho=0
> MetaSKAT_wZ(Z.list[[1]], obj)$p.value
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
MetaSKAT
 --- call from context --- 
Meta_SKAT_MAIN_Check_Z(Z, n, obj.res$id_include, SetID, impute.method = impute.method)
 --- call from argument --- 
if (class(Z) != "matrix") stop("Z is not a matrix")
 --- R stacktrace ---
where 1: Meta_SKAT_MAIN_Check_Z(Z, n, obj.res$id_include, SetID, impute.method = impute.method)
where 2: Meta_SKAT_SaveData(Z1, obj$out[[i]], SetID = NULL, impute.method = impute.method)
where 3: MetaSKAT_wZ(Z.list[[1]], obj)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (Z, n, id_include, SetID, is_dosage = FALSE, impute.method = "fixed") 
{
    m = ncol(Z)
    if (class(Z) != "matrix") 
        stop("Z is not a matrix")
    if (nrow(Z) != n) 
        stop("Dimensions of y and Z do not match")
    if (is_dosage == TRUE) {
        impute.method = "fixed"
    }
    IDX_MISS <- union(which(is.na(Z)), which(Z == 9))
    if (length(IDX_MISS) > 0) {
        Z[IDX_MISS] <- NA
    }
    missing.ratio <- rep(0, m)
    for (i in 1:m) {
        missing.ratio[i] <- length(which(is.na(Z[, i])))/n
        if (missing.ratio[i] > 0.9) {
            Z[, i] <- 0
        }
    }
    MAF <- colMeans(Z, na.rm = TRUE)/2
    IDX.Err <- which(MAF > 0.5)
    if (length(IDX.Err) > 0) {
        msg <- sprintf("Genotypes of some variants are not the number of minor alleles!")
    }
    Z <- SKAT:::Impute(Z, impute.method)
    Z <- cbind(Z)
    Z.test <- as.matrix(Z[id_include, ])
    return(list(Z.test = Z.test, missing_rate = missing.ratio, 
        MAF = MAF, return = 0))
}
<bytecode: 0x4a4c6b8>
<environment: namespace:MetaSKAT>
 --- function search by body ---
Function Meta_SKAT_MAIN_Check_Z in namespace MetaSKAT has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(Z) != "matrix") stop("Z is not a matrix") : 
  the condition has length > 1
Calls: MetaSKAT_wZ -> Meta_SKAT_SaveData -> Meta_SKAT_MAIN_Check_Z
Execution halted