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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: add_random_module_to_network
> ### Title: Adds a random module of a given size to the network
> ### Aliases: add_random_module_to_network
> 
> ### ** Examples
> 
> # This function provides an alternative way to iteratively add random
> # modules to the network. It uses a weighted sampling of nodes, where
> # nodes that haven't been selected for a module have a higher probability 
> # of being sampled for the new module.
> nw <- create_empty_network(100)
> plot(nw) # An empty network of 100 nodes.
> # Add random modules of size 10 to the network, 1 at a time.
> # By plotting the network each time, we can watch it grow.
> set.seed(12345)
> plot(nw <<- add_random_module_to_network(nw, 10))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
SeqNet
 --- call from context --- 
rewire_connections_to_node.matrix(adj, i, prob_rewire, weights, 
    alpha, beta, epsilon, run_checks = FALSE, ...)
 --- call from argument --- 
if (!(class(x) == "matrix")) stop(paste0("'", deparse(substitute(x)), 
    "' is not a 'matrix' object."))
 --- R stacktrace ---
where 1: rewire_connections_to_node.matrix(adj, i, prob_rewire, weights, 
    alpha, beta, epsilon, run_checks = FALSE, ...)
where 2: rewire_connections_to_node(adj, i, prob_rewire, weights, alpha, 
    beta, epsilon, run_checks = FALSE, ...)
where 3: random_module_structure(length(nodes), ...)
where 4: random_module(nodes, weights = deg[nodes], ...)
where 5: add_random_module_to_network(nw, 10)
where 6: plot(nw <<- add_random_module_to_network(nw, 10))

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (x, node, prob_rewire = 1, weights = NULL, alpha = 100, 
    beta = 1, epsilon = 10^-5, run_checks = TRUE, ...) 
{
    if (!(class(x) == "matrix")) 
        stop(paste0("'", deparse(substitute(x)), "' is not a 'matrix' object."))
    if (run_checks && is_weighted(x)) {
        warning("'", deparse(substitute(x)), "' is weighted.", 
            "Edge weights are removed prior to rewiring.")
        x <- remove_weights(x)
    }
    if (run_checks && !is_adjacency_cpp(x)) {
        stop("'", deparse(substitute(x)), "' is not an adjacency matrix.")
    }
    nodes <- get_node_names(x)
    p <- length(nodes)
    if (node <= 0) 
        stop("Argument 'node' must be a positive integer.")
    if (prob_rewire < 0 || prob_rewire > 1) 
        stop("Argument 'prob_rewire' must be in [0, 1].")
    if (!is.null(weights) && (length(weights) != p || !is.numeric(weights))) 
        stop("'", deparse(substitute(weights)), "' is not a numeric vector of length", 
            " equal to the number of nodes in m.")
    if (is.null(weights)) {
        weights <- rep(0, p)
    }
    if (node %in% nodes) {
        node_index <- which(node == nodes)
        degree <- colSums(x)
        weights <- weights + degree
        if (degree[node_index] > 0 && degree[node_index] != (p - 
            1)) {
            neighbors <- which(x[, node_index] != 0)
            available <- (1:p)[-c(node_index, neighbors)]
            n_rewire <- sum(runif(length(neighbors)) < prob_rewire)
            if (n_rewire > 0) {
                if (length(neighbors) == 1) {
                  neighbors <- neighbors
                }
                else {
                  neighbors <- sample(neighbors, n_rewire)
                }
                for (old_neighbor in neighbors) {
                  if (length(available) == 1) {
                    new_neighbor <- available
                  }
                  else {
                    new_neighbor <- sample(available, 1, prob = pbeta(ecdf_cpp(weights[available]), 
                      alpha, beta) + epsilon)
                  }
                  x[old_neighbor, node_index] <- 0
                  x[node_index, old_neighbor] <- 0
                  x[new_neighbor, node_index] <- 1
                  x[node_index, new_neighbor] <- 1
                  available[which(available == new_neighbor)] <- old_neighbor
                  weights[new_neighbor] <- weights[new_neighbor] + 
                    1
                  weights[old_neighbor] <- weights[old_neighbor] - 
                    1
                }
            }
        }
    }
    else {
        warning("'", deparse(substitute(node)), "' is not a node in 'x'.", 
            "Returning 'x' unmodified.")
    }
    return(x)
}
<bytecode: 0x560c6e7e58a8>
<environment: namespace:SeqNet>
 --- function search by body ---
Function rewire_connections_to_node.matrix in namespace SeqNet has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1