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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: neat
> ### Title: Performs neat for lists of gene sets
> ### Aliases: neat pvalue neatc
> ### Keywords: htest
> 
> ### ** Examples
> 
> # Example 1: network given as adjacency matrix:
> A = matrix(0, nrow=7, ncol=7)
> A[1,c(2,3)]=1; A[2,c(5,7)]=1;A[3,c(1,4)]=1;A[4,c(2,5,7)]=1;A[6,c(2,5)]=1;A[7,4]=1
> labels = letters[1:7]
> set1 = c('a','e')
> set2 = c('c','g')
> set3 = c('d','f')
> alist = list('set 1' = set1, 'set 2' = set2)
> blist = list('set 3' = set3)
> 
> test1 = neat(alist = alist, blist = blist, network=A, 
+              nettype='directed', nodes=labels, alpha=0.05)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
neat
 --- call from context --- 
neat(alist = alist, blist = blist, network = A, nettype = "directed", 
    nodes = labels, alpha = 0.05)
 --- call from argument --- 
if (class(network) == "igraph") {
    requireNamespace("igraph", quietly = TRUE)
    net = networkmatrix(network, nodes, nettype)
} else if (class(network) == "matrix" & ncol(network) > 2) {
    if (isSymmetric(network) == TRUE & nettype == "directed") {
        warning("The adjacency matrix is symmetric. Should you set nettype = \"undirected\"?")
    }
    if (isSymmetric(network) == FALSE & nettype == "undirected") {
        warning("The adjacency matrix is not symmetric. Should you set nettype = \"directed\"?")
    }
    net = networkmatrix(network, nodes, nettype)
} else if (class(network) == "dgCMatrix") {
    requireNamespace("Matrix", quietly = TRUE)
    net = networkmatrix(network, nodes, nettype)
} else if (class(network) == "matrix" & ncol(network) == 2) net = network
 --- R stacktrace ---
where 1: neat(alist = alist, blist = blist, network = A, nettype = "directed", 
    nodes = labels, alpha = 0.05)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (alist, blist = NULL, network, nettype, nodes, alpha = NULL, 
    anames = NULL, bnames = NULL) 
{
    if (is.null(alpha) == FALSE) {
        if (alpha <= 0 | alpha >= 1) 
            stop("alpha must be in (0,1)")
    }
    if ((nettype %in% c("directed", "undirected")) == FALSE) 
        stop("nettype must be either 'directed' or 'undirected' ")
    if (nettype == "directed" & is.null(blist)) 
        stop("blist cannot be null when nettype == 'directed' (see manual)")
    if (class(network) == "igraph") {
        requireNamespace("igraph", quietly = TRUE)
        net = networkmatrix(network, nodes, nettype)
    }
    else if (class(network) == "matrix" & ncol(network) > 2) {
        if (isSymmetric(network) == TRUE & nettype == "directed") {
            warning("The adjacency matrix is symmetric. Should you set nettype = \"undirected\"?")
        }
        if (isSymmetric(network) == FALSE & nettype == "undirected") {
            warning("The adjacency matrix is not symmetric. Should you set nettype = \"directed\"?")
        }
        net = networkmatrix(network, nodes, nettype)
    }
    else if (class(network) == "dgCMatrix") {
        requireNamespace("Matrix", quietly = TRUE)
        net = networkmatrix(network, nodes, nettype)
    }
    else if (class(network) == "matrix" & ncol(network) == 2) 
        net = network
    if (is.factor(nodes) == T) {
        nodes = as.character(nodes)
    }
    oa = numeric()
    ib = numeric()
    nab = numeric()
    alogic = vector("list", length(alist))
    netred = vector("list", length(alist))
    p = numeric()
    expect = numeric()
    o = vector()
    concl = vector()
    from = vector()
    to = vector()
    if (nettype == "undirected") {
        eina = vector("list", length(alist))
        alogic2 = alogic
        if (is.null(names(alist))) 
            names(alist) = anames
        for (i in 1:length(alist)) {
            if (is.factor(alist[[i]]) == T) {
                alist[[i]] = as.character(alist[[i]])
            }
            eina[[i]] = (net[, 1] %in% alist[[i]]) | (net[, 2] %in% 
                alist[[i]])
            if (sum(eina[[i]]) == 1) 
                netred[[i]] = as.matrix(t(net[eina[[i]], ]))
            else if (sum(eina[[i]]) == 0) 
                stop(paste("There are no edges connected to genes in", 
                  names(alist)[i], ". The test cannot be computed."))
            else netred[[i]] = net[eina[[i]], ]
            alogic[[i]] = (netred[[i]][, 1] %in% alist[[i]])
            alogic2[[i]] = (netred[[i]][, 2] %in% alist[[i]])
            oa[i] = sum(alogic[[i]]) + sum(alogic2[[i]])
        }
        if (is.null(blist) == FALSE) {
            blogic = vector("list", length(blist))
            blogic2 = blogic
            einb = vector("list", length(blist))
            if (is.null(names(blist))) 
                names(blist) = bnames
            for (i in 1:length(blist)) {
                if (is.factor(blist[[i]]) == T) {
                  blist[[i]] = as.character(blist[[i]])
                }
                einb[[i]] = (net[, 1] %in% blist[[i]]) | (net[, 
                  2] %in% blist[[i]])
                if (sum(einb[[i]]) == 0) 
                  stop(paste("There are no edges connected to genes in", 
                    names(blist)[i], ". The test cannot be computed."))
                else if (sum(einb[[i]]) == 1) {
                  temp = as.matrix(t(net[einb[[i]], ]))
                  blogic[[i]] = (temp[, 1] %in% blist[[i]])
                  blogic2[[i]] = (temp[, 2] %in% blist[[i]])
                }
                else {
                  blogic[[i]] = (net[einb[[i]], ][, 1] %in% blist[[i]])
                  blogic2[[i]] = (net[einb[[i]], ][, 2] %in% 
                    blist[[i]])
                }
                ib[i] = sum(blogic[[i]]) + sum(blogic2[[i]])
            }
            k = 1
            for (i in 1:length(alist)) {
                for (j in 1:length(blist)) {
                  from[k] = names(alist)[i]
                  to[k] = names(blist)[j]
                  link = (alogic[[i]] & netred[[i]][, 2] %in% 
                    blist[[j]]) | (alogic2[[i]] & netred[[i]][, 
                    1] %in% blist[[j]])
                  nab[k] = sum(link)
                  temp = pvalue(nab[k], ss = oa[i], K = ib[j], 
                    N = 2 * dim(net)[1])
                  p[k] = temp$p
                  expect[k] = round(ib[j] * oa[i]/(2 * dim(net)[1]), 
                    4)
                  o[k] = temp$overenr
                  if (is.null(alpha) == FALSE) {
                    if (p[k] > alpha) 
                      concl[k] = "No enrichment"
                    else if (p[k] <= alpha & o[k] == T) 
                      concl[k] = "Overenrichment"
                    else if (p[k] <= alpha & o[k] == F) 
                      concl[k] = "Underenrichment"
                  }
                  k = k + 1
                }
            }
        }
        if (is.null(blist) == TRUE) {
            ib = oa
            k = 1
            for (i in 1:(length(alist) - 1)) {
                for (j in (i + 1):length(alist)) {
                  from[k] = names(alist)[i]
                  to[k] = names(alist)[j]
                  link = (alogic[[i]] & netred[[i]][, 2] %in% 
                    alist[[j]]) | (alogic2[[i]] & netred[[i]][, 
                    1] %in% alist[[j]])
                  nab[k] = sum(link)
                  temp = pvalue(nab[k], ss = oa[i], K = ib[j], 
                    N = 2 * dim(net)[1])
                  p[k] = temp$p
                  expect[k] = round(ib[j] * oa[i]/(2 * dim(net)[1]), 
                    4)
                  o[k] = temp$overenr
                  if (is.null(alpha) == FALSE) {
                    if (p[k] > alpha) 
                      concl[k] = "No enrichment"
                    else if (p[k] <= alpha & o[k] == T) 
                      concl[k] = "Overenrichment"
                    else if (p[k] <= alpha & o[k] == F) 
                      concl[k] = "Underenrichment"
                  }
                  k = k + 1
                }
            }
        }
    }
    if (nettype == "directed") {
        if (is.null(names(alist))) 
            names(alist) = anames
        for (i in 1:length(alist)) {
            if (is.factor(alist[[i]]) == T) {
                alist[[i]] = as.character(alist[[i]])
            }
            alogic[[i]] = (net[, 1] %in% alist[[i]])
            oa[i] = sum(alogic[[i]])
            if (sum(alogic[[i]]) == 1) 
                netred[[i]] = as.matrix(t(net[alogic[[i]], ]))
            else if (sum(alogic[[i]]) == 0) 
                stop(paste("There are no arrows going out from genes in", 
                  names(alist)[i]), ". The test cannot be computed.")
            else netred[[i]] = net[alogic[[i]], ]
        }
        if (is.null(blist) == FALSE) {
            blogic = vector("list", length(blist))
            if (is.null(names(blist))) 
                names(blist) = bnames
            for (i in 1:length(blist)) {
                if (is.factor(blist[[i]]) == T) {
                  blist[[i]] = as.character(blist[[i]])
                }
                blogic[[i]] = (net[, 2] %in% blist[[i]])
                ib[i] = sum(blogic[[i]])
            }
            k = 1
            for (i in 1:length(alist)) {
                for (j in 1:length(blist)) {
                  from[k] = names(alist)[i]
                  to[k] = names(blist)[j]
                  nab[k] = sum(netred[[i]][, 2] %in% blist[[j]])
                  temp = pvalue(nab[k], ss = oa[i], K = ib[j], 
                    N = dim(net)[1])
                  p[k] = temp$p
                  expect[k] = round(ib[j] * oa[i]/dim(net)[1], 
                    4)
                  o[k] = temp$overenr
                  if (is.null(alpha) == FALSE) {
                    if (p[k] > alpha) 
                      concl[k] = "No enrichment"
                    else if (p[k] <= alpha & o[k] == T) 
                      concl[k] = "Overenrichment"
                    else if (p[k] <= alpha & o[k] == F) 
                      concl[k] = "Underenrichment"
                  }
                  k = k + 1
                }
            }
        }
    }
    if (is.null(alpha) == FALSE) {
        results = data.frame(from, to, nab, expect, p, concl)
        names(results) = c("A", "B", "nab", "expected_nab", "pvalue", 
            "conclusion")
    }
    else {
        results = data.frame(from, to, nab, expect, p)
        names(results) = c("A", "B", "nab", "expected_nab", "pvalue")
    }
    class(results) = c("neat", "data.frame")
    results
}
<bytecode: 0x265bfb8>
<environment: namespace:neat>
 --- function search by body ---
Function neat in namespace neat has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1