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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: mcount
> ### Title: Count bipartite motifs
> ### Aliases: mcount
> 
> ### ** Examples
> 
> set.seed(123)
> row <- 10
> col <- 10
> m <- matrix(sample(0:1, row*col, replace=TRUE), row, col)
> mcount(M = m, six_node = TRUE, normalise = TRUE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
bmotif
 --- call from context --- 
mcount(M = m, six_node = TRUE, normalise = TRUE)
 --- call from argument --- 
if (class(M) != "matrix") {
    stop("'M' must be an object of class 'matrix'")
}
 --- R stacktrace ---
where 1: mcount(M = m, six_node = TRUE, normalise = TRUE)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (M, six_node, normalise) 
{
    if (class(M) != "matrix") {
        stop("'M' must be an object of class 'matrix'")
    }
    if (!all(apply(M, 1:2, is.numeric))) {
        stop("Elements of 'M' must be numeric")
    }
    if (!all(apply(M, 1:2, function(x) length(x) > 0))) {
        stop("Elements of 'M' cannot have length zero")
    }
    if (!all(apply(M, 1:2, function(x) x >= 0))) {
        stop("Elements of 'M' must be greater than or equal to zero")
    }
    if (class(normalise) != "logical") {
        stop("'normalise' must be of class 'logical' i.e. TRUE or FALSE")
    }
    if (class(six_node) != "logical") {
        stop("'six_node' must be of class 'logical' i.e. TRUE or FALSE")
    }
    M[M > 0] <- 1
    dimnames(M) <- NULL
    p <- dim(M)[2]
    z <- dim(M)[1]
    J <- matrix(rep(1, z * p), nrow = z, ncol = p)
    JP <- matrix(rep(1, p * p), nrow = p, ncol = p)
    JZ <- matrix(rep(1, z * z), nrow = z, ncol = z)
    MT <- t(M)
    N <- J - M
    NT <- t(N)
    P <- MT %*% M
    Q <- MT %*% N
    R <- NT %*% M
    Z <- M %*% MT
    Y <- M %*% NT
    X <- N %*% MT
    dP <- apply(M, MARGIN = 2, sum)
    jP <- rep(1, p)
    dZ <- apply(M, MARGIN = 1, sum)
    jZ <- rep(1, z)
    if (six_node == TRUE) {
        if (p < z) {
            J3 <- array(rep(1, p * p * p), c(p, p, p))
            AP <- maketensor(M, M)
            BP <- maketensor(M, N)
            CP <- maketensor(N, M)
            DP <- maketensor(N, N)
            MA <- tensor::tensor(MT, AP, 2, 1)
            MB <- tensor::tensor(MT, BP, 2, 1)
            MC <- tensor::tensor(MT, CP, 2, 1)
            MD <- tensor::tensor(MT, DP, 2, 1)
            Na <- tensor::tensor(NT, AP, 2, 1)
            NB <- tensor::tensor(NT, BP, 2, 1)
            NC <- tensor::tensor(NT, CP, 2, 1)
            K3 <- J3
            for (i in 1:p) {
                for (j in 1:p) {
                  K3[i, j, j] <- 0
                  K3[j, i, j] <- 0
                  K3[j, j, i] <- 0
                }
            }
        }
        if (p >= z) {
            J3 <- array(rep(1, z * z * z), c(z, z, z))
            AP <- maketensor(MT, MT)
            BP <- maketensor(MT, NT)
            CP <- maketensor(NT, MT)
            DP <- maketensor(NT, NT)
            MA <- tensor::tensor(M, AP, 2, 1)
            MB <- tensor::tensor(M, BP, 2, 1)
            MC <- tensor::tensor(M, CP, 2, 1)
            MD <- tensor::tensor(M, DP, 2, 1)
            Na <- tensor::tensor(N, AP, 2, 1)
            NB <- tensor::tensor(N, BP, 2, 1)
            NC <- tensor::tensor(N, CP, 2, 1)
            K3 <- J3
            for (i in 1:z) {
                for (j in 1:z) {
                  K3[i, j, j] <- 0
                  K3[j, i, j] <- 0
                  K3[j, j, i] <- 0
                }
            }
        }
        MA <- MA * K3
        MB <- MB * K3
        MC <- MC * K3
        MD <- MD * K3
        Na <- Na * K3
        NB <- NB * K3
        NC <- NC * K3
    }
    if (six_node == FALSE) {
        if (normalise == TRUE) {
            out <- data.frame(motif = 1:17, nodes = c(2, rep(3, 
                2), rep(4, 4), rep(5, 10)), frequency = NA, normalise_sum = NA, 
                normalise_sizeclass = NA, normalise_nodesets = NA)
        }
        else {
            out <- data.frame(motif = 1:17, nodes = c(2, rep(3, 
                2), rep(4, 4), rep(5, 10)), frequency = NA)
        }
    }
    else {
        if (normalise == TRUE) {
            out <- data.frame(motif = 1:44, nodes = c(2, rep(3, 
                2), rep(4, 4), rep(5, 10), rep(6, 27)), frequency = NA, 
                normalise_sum = NA, normalise_sizeclass = NA, 
                normalise_nodesets = NA)
        }
        else {
            out <- data.frame(motif = 1:44, nodes = c(2, rep(3, 
                2), rep(4, 4), rep(5, 10), rep(6, 27)), frequency = NA)
        }
    }
    if (six_node == FALSE) {
        for (i in 1:17) {
            out[i, "frequency"] <- countmotif(x = M, motif = i, 
                z = z, p = p, JP = JP, JZ = JZ, P = P, Q = Q, 
                R = R, Z = Z, Y = Y, X = X, dP = dP, jP = jP, 
                dZ = dZ, jZ = jZ)
        }
    }
    else {
        for (i in 1:44) {
            out[i, "frequency"] <- countmotif(x = M, motif = i, 
                z = z, p = p, JP = JP, JZ = JZ, P = P, Q = Q, 
                R = R, Z = Z, Y = Y, X = X, dP = dP, jP = jP, 
                dZ = dZ, jZ = jZ, J3 = J3, MA = MA, MB = MB, 
                MC = MC, MD = MD, Na = Na, NB = NB, NC = NC)
        }
    }
    if (normalise == TRUE) {
        out$normalise_sum <- out$frequency/sum(out$frequency)
        out$normalise_sizeclass <- do.call("c", lapply(split(out, 
            out$nodes), function(df) df$frequency/sum(df$frequency)))
        sets <- node_sets(M, six_node = six_node)
        out$normalise_nodesets <- out$frequency/sets
    }
    return(out)
}
<bytecode: 0x55afb0be4ca8>
<environment: namespace:bmotif>
 --- function search by body ---
Function mcount in namespace bmotif has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1