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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: runSAM
> ### Title: SAM analysis with siggenes package
> ### Aliases: runSAM
> ### Keywords: nonparametric htest
> 
> ### ** Examples
> 
> ## load data
> data(marty)
> 
> ## Not run: 
> ##D ## filtering data
> ##D marty <- expFilter(marty, threshold=3.5, graph=FALSE)
> ## End(Not run)
> 
> ##Class label 0/1
> marty.type.num <- ifelse(marty.type.cl=="Her2+",0,1)
> 
> ## run sam analysis on example set
> example.subset <- marty[1:100,]
> samOUT <- runSAM(example.subset, marty.type.num, nbpermut=50, q=0.05, plot=TRUE)
SAM analysis is running...
Create table for all genes...
   Delta  p0 False Called        FDR
1   0.10 0.7  62.0     78 0.55641026
2   0.15 0.7  62.0     78 0.55641026
3   0.20 0.7  60.0     77 0.54545455
4   0.25 0.7  48.0     68 0.49411765
5   0.30 0.7  37.5     59 0.44491525
6   0.35 0.7  33.5     58 0.40431034
7   0.40 0.7  30.0     55 0.38181818
8   0.45 0.7  22.5     50 0.31500000
9   0.50 0.7  20.0     48 0.29166667
10  0.55 0.7  16.5     42 0.27500000
11  0.60 0.7   7.0     28 0.17500000
12  0.65 0.7   6.0     27 0.15555556
13  0.70 0.7   5.0     26 0.13461538
14  0.75 0.7   3.5     24 0.10208333
15  0.80 0.7   3.5     23 0.10652174
16  0.85 0.7   3.0     21 0.10000000
17  0.90 0.7   3.0     21 0.10000000
18  0.95 0.7   2.0     17 0.08235294
19  1.00 0.7   1.0     16 0.04375000
20  1.05 0.7   1.0     16 0.04375000
Find delta...
The threshold seems to be at 
     Delta Called      FDR
5 0.991778     17 0.082353
6 0.991779     16 0.043750
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
EMA
 --- call from context --- 
runSAM(example.subset, marty.type.num, nbpermut = 50, q = 0.05, 
    plot = TRUE)
 --- call from argument --- 
if (class(outdelta) == "matrix") {
    delta <- outdelta[2, 1]
    print(paste("Delta : ", delta, sep = ""))
    message("Create SAM plot...")
    if (plot) {
        plot(output, delta)
    }
    alllist$Significant <- rep(FALSE, nrow(alllist))
    if (outdelta[2, 1] != 0) {
        delta.sum <- summary(output, delta)
        ds.mat.sig <- delta.sum@mat.sig
        rows <- ds.mat.sig$Row
        print(paste("Find", length(rows), "significant genes ..."))
        alllist[rows, "Significant"] <- TRUE
    }
} else message("Can't find delta with chosen FDR... No SAM plot... No Significant slots in out data.frame...")
 --- R stacktrace ---
where 1: runSAM(example.subset, marty.type.num, nbpermut = 50, q = 0.05, 
    plot = TRUE)

 --- value of length: 2 type: logical ---
[1]  TRUE FALSE
 --- function from context --- 
function (data, labels, nbpermut = 500, q = 0.05, plot = TRUE, 
    method = "d.stat", var.equal = TRUE, include.zero = FALSE, 
    paired = FALSE, seed = 123) 
{
    if (paired == FALSE) {
        labels <- as.integer(factor(labels)) - 1
    }
    message("SAM analysis is running...")
    if (method == "d.stat") 
        output <- sam(data, cl = labels, B = nbpermut, method = "d.stat", 
            var.equal = var.equal, include.zero = include.zero, 
            rand = seed, control = samControl(delta = seq(0.1, 
                10, 0.05), lambda = 0.5), med = TRUE)
    if (method == "wilc.stat") 
        output <- sam(data, cl = labels, method = "wilc.stat")
    if (method == "chisq.stat") 
        output <- sam(data, cl = labels, method = "chisq.stat", 
            B = nbpermut, rand = seed)
    if (method == "trend.stat") 
        output <- sam(data, cl = labels, method = "trend.stat", 
            B = nbpermut, rand = seed)
    message("Create table for all genes...")
    if (length(unique(labels)) == 2 & (method == "d.stat" || 
        method == "wilc.stat")) {
        alllist <- data.frame(rownames(data), output@d, output@p.value, 
            output@fold)
        colnames(alllist) <- c("probeID", "Stat", "RawpValue", 
            "FoldChange")
    }
    else {
        alllist <- data.frame(rownames(data), output@d, output@p.value)
        colnames(alllist) <- c("probeID", "Stat", "RawpValue")
    }
    alllist$probeID = as.character(alllist$probeID)
    print(output@mat.fdr[which(output@mat.fdr[, "FDR"] > 0), 
        c("Delta", "p0", "False", "Called", "FDR")])
    message("Find delta...")
    outdelta <- try(findDelta(output, fdr = q))
    if (class(outdelta) == "matrix") {
        delta <- outdelta[2, 1]
        print(paste("Delta : ", delta, sep = ""))
        message("Create SAM plot...")
        if (plot) {
            plot(output, delta)
        }
        alllist$Significant <- rep(FALSE, nrow(alllist))
        if (outdelta[2, 1] != 0) {
            delta.sum <- summary(output, delta)
            ds.mat.sig <- delta.sum@mat.sig
            rows <- ds.mat.sig$Row
            print(paste("Find", length(rows), "significant genes ..."))
            alllist[rows, "Significant"] <- TRUE
        }
    }
    else message("Can't find delta with chosen FDR... No SAM plot... No Significant slots in out data.frame...")
    message("The adjusted pvalue is a qvalue, and is not related to the significant genes found with the SAM's FDR")
    return(alllist)
}
<bytecode: 0xe6ae810>
<environment: namespace:EMA>
 --- function search by body ---
Function runSAM in namespace EMA has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1