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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: backbone.extract
> ### Title: Extracts the backbone of a weighted network using results from a
> ###   null model
> ### Aliases: backbone.extract
> 
> ### ** Examples
> 
> probs <- sdsm(davis, 100)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
backbone
 --- call from context --- 
sdsm(davis, 100)
 --- call from argument --- 
if (class(B) != "matrix") {
    stop("input bipartite data must be a matrix")
}
 --- R stacktrace ---
where 1: sdsm(davis, 100)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (B, trials = 1000, model = "logit", sparse = TRUE, maxiter = 25, 
    dyad = NULL, progress = FALSE) 
{
    if ((sparse != "TRUE") & (sparse != "FALSE")) {
        stop("sparse must be either TRUE or FALSE")
    }
    if ((model != "logit") & (model != "probit") & (model != 
        "log") & (model != "cloglog")) {
        stop("model must be: logit | probit | log | cloglog")
    }
    if ((trials < 1) | (trials%%1 != 0)) {
        stop("trials must be a positive integer")
    }
    if (class(B) != "matrix") {
        stop("input bipartite data must be a matrix")
    }
    if (sparse == "TRUE") {
        B <- Matrix::Matrix(B, sparse = T)
        P <- B %*% Matrix::t(B)
    }
    if (sparse == "FALSE") {
        P <- B %*% t(B)
    }
    Positive <- matrix(0, nrow(P), ncol(P))
    Negative <- matrix(0, nrow(P), ncol(P))
    A <- data.frame(as.vector(B))
    names(A)[names(A) == "as.vector.B."] <- "value"
    A$row <- rep(1:nrow(B), times = ncol(B))
    A$col <- rep(1:ncol(B), each = nrow(B))
    A$rowmarg <- stats::ave(A$value, A$row, FUN = sum)
    A$colmarg <- stats::ave(A$value, A$col, FUN = sum)
    A$rowcol <- A$rowmarg * A$colmarg
    model.estimates <- stats::glm(formula = value ~ rowmarg + 
        colmarg + rowcol, family = stats::binomial(link = model), 
        data = A, control = list(maxit = maxiter))
    probs <- as.vector(stats::predict(model.estimates, newdata = A, 
        type = "response"))
    edge_weights <- numeric(trials)
    if (length(dyad) > 0) {
        if (class(dyad[1]) != "numeric") {
            vec <- match(c(dyad[1], dyad[2]), rownames(B))
        }
        else {
            vec <- dyad
        }
    }
    for (i in 1:trials) {
        if (i == 1) {
            start.time <- Sys.time()
            message("Finding the Backbone using ", model, " SDSM")
        }
        Bstar <- matrix(((stats::runif(nrow(B) * ncol(B))) <= 
            probs) + 0, nrow(B), ncol(B))
        if (sparse == "TRUE") {
            Bstar <- Matrix::Matrix(Bstar, sparse = T)
        }
        if (sparse == "TRUE") {
            Pstar <- Bstar %*% Matrix::t(Bstar)
        }
        if (sparse == "FALSE") {
            Pstar <- Bstar %*% t(Bstar)
        }
        Positive <- Positive + (Pstar > P) + 0
        Negative <- Negative + (Pstar < P) + 0
        if (length(dyad) > 0) {
            edge_weights[i] <- Pstar[vec[1], vec[2]]
        }
        if (i == 10) {
            end.time <- Sys.time()
            est = (round(difftime(end.time, start.time), 2) * 
                (trials/10))
            message("Estimated time to complete is ", est, " ", 
                units(est))
            if (progress == "TRUE") {
                pb <- utils::txtProgressBar(min = 0, max = trials, 
                  style = 3)
            }
        }
        if ((progress == "TRUE") & (i >= 10)) {
            utils::setTxtProgressBar(pb, i)
        }
    }
    if (progress == "TRUE") {
        close(pb)
    }
    Positive <- (Positive/trials)
    Negative <- (Negative/trials)
    rownames(Positive) <- rownames(B)
    colnames(Positive) <- rownames(B)
    rownames(Negative) <- rownames(B)
    colnames(Negative) <- rownames(B)
    if (length(dyad) == 0) {
        edge_weights <- NULL
    }
    if (length(dyad) > 0) {
        return(list(positive = Positive, negative = Negative, 
            dyad_values = edge_weights))
    }
    else {
        return(list(positive = Positive, negative = Negative))
    }
}
<bytecode: 0x558347577598>
<environment: namespace:backbone>
 --- function search by body ---
Function sdsm in namespace backbone has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1