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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: add.isolates
> ### Title: Add Isolates to a Graph
> ### Aliases: add.isolates
> ### Keywords: manip math graphs
> 
> ### ** Examples
> 
> 
> g<-rgraph(10,5)		#Produce some random graphs
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
sna
 --- call from context --- 
FUN(X[[i]], ...)
 --- call from argument --- 
if (class(x) %in% c("matrix.csr", "matrix.csc", "matrix.ssr", 
    "matrix.ssc", "matrix.hb")) {
    requireNamespace("SparseM")
    bip <- attr(x, "bipartite")
    g <- as.matrix(x)
    attr(g, "bipartite") <- bip
} else {
    n <- attr(x, "n")
    bip <- attr(x, "bipartite")
    vnam <- attr(x, "vnames")
    if (is.array(x) && (length(dim(x)) == 2)) 
        x <- as.matrix(x)
    if (is.data.frame(x)) 
        x <- as.matrix(x)
    if (is.matrix(x)) {
        if ((NCOL(x) %in% c(2, 3)) && (!is.null(n))) {
            if (NCOL(x) == 2) 
                x <- cbind(x, rep(1, NROW(x)))
            g <- matrix(0, n, n)
            if (NROW(x) > 0) 
                g[x[, 1:2, drop = FALSE]] <- x[, 3]
            rownames(g) <- vnam
            colnames(g) <- vnam
        }
        else if (force.bipartite || (!is.null(bip)) || (NROW(x) != 
            NCOL(x))) {
            nr <- NROW(x)
            nc <- NCOL(x)
            g <- matrix(0, nr + nc, nr + nc)
            g[1:nr, (nr + 1):(nr + nc)] <- x
            g[(nr + 1):(nr + nc), 1:nr] <- t(x)
            rownames(g) <- vnam
            colnames(g) <- vnam
        }
        else {
            g <- x
        }
    }
    else if (is.array(x)) {
        if (length(dim(x)) != 3) 
            stop("as.sociomatrix.sna input must be an adjacency matrix/array, network, data frame, sparse matrix, or list.")
        if (force.bipartite || (!is.null(attr(x, "bipartite"))) || 
            (dim(x)[2] != dim(x)[3])) {
            dx <- dim(x)
            nr <- dx[2]
            nc <- dx[3]
            g <- array(0, dim = c(dx[1], nr + nc, nr + nc))
            for (i in 1:dx[1]) {
                g[i, 1:nr, (nr + 1):(nr + nc)] <- x[i, , ]
                g[i, (nr + 1):(nr + nc), 1:nr] <- t(x[i, , ])
            }
        }
        else {
            g <- x
        }
    }
    else {
        stop("as.sociomatrix.sna input must be an adjacency matrix/array, network, or list.")
    }
}
 --- R stacktrace ---
where 1: FUN(X[[i]], ...)
where 2: lapply(x, as.sociomatrix.sna, attrname = attrname, simplify = simplify, 
    force.bipartite = force.bipartite)
where 3: as.sociomatrix.sna(g)
where 4: rgraph(10, 5)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, attrname = NULL, simplify = TRUE, force.bipartite = FALSE) 
{
    if ((is.list(x) && !any(class(x) == "network")) && (!(class(x) %in% 
        c("network", "matrix.csr", "matrix.csc", "matrix.ssr", 
            "matrix.ssc", "matrix.hb", "data.frame")))) {
        g <- lapply(x, as.sociomatrix.sna, attrname = attrname, 
            simplify = simplify, force.bipartite = force.bipartite)
    }
    else if (any(class(x) == "network")) {
        g <- as.sociomatrix(x, attrname = attrname, simplify = simplify)
    }
    else if (class(x) %in% c("matrix.csr", "matrix.csc", "matrix.ssr", 
        "matrix.ssc", "matrix.hb")) {
        requireNamespace("SparseM")
        bip <- attr(x, "bipartite")
        g <- as.matrix(x)
        attr(g, "bipartite") <- bip
    }
    else {
        n <- attr(x, "n")
        bip <- attr(x, "bipartite")
        vnam <- attr(x, "vnames")
        if (is.array(x) && (length(dim(x)) == 2)) 
            x <- as.matrix(x)
        if (is.data.frame(x)) 
            x <- as.matrix(x)
        if (is.matrix(x)) {
            if ((NCOL(x) %in% c(2, 3)) && (!is.null(n))) {
                if (NCOL(x) == 2) 
                  x <- cbind(x, rep(1, NROW(x)))
                g <- matrix(0, n, n)
                if (NROW(x) > 0) 
                  g[x[, 1:2, drop = FALSE]] <- x[, 3]
                rownames(g) <- vnam
                colnames(g) <- vnam
            }
            else if (force.bipartite || (!is.null(bip)) || (NROW(x) != 
                NCOL(x))) {
                nr <- NROW(x)
                nc <- NCOL(x)
                g <- matrix(0, nr + nc, nr + nc)
                g[1:nr, (nr + 1):(nr + nc)] <- x
                g[(nr + 1):(nr + nc), 1:nr] <- t(x)
                rownames(g) <- vnam
                colnames(g) <- vnam
            }
            else {
                g <- x
            }
        }
        else if (is.array(x)) {
            if (length(dim(x)) != 3) 
                stop("as.sociomatrix.sna input must be an adjacency matrix/array, network, data frame, sparse matrix, or list.")
            if (force.bipartite || (!is.null(attr(x, "bipartite"))) || 
                (dim(x)[2] != dim(x)[3])) {
                dx <- dim(x)
                nr <- dx[2]
                nc <- dx[3]
                g <- array(0, dim = c(dx[1], nr + nc, nr + nc))
                for (i in 1:dx[1]) {
                  g[i, 1:nr, (nr + 1):(nr + nc)] <- x[i, , ]
                  g[i, (nr + 1):(nr + nc), 1:nr] <- t(x[i, , 
                    ])
                }
            }
            else {
                g <- x
            }
        }
        else {
            stop("as.sociomatrix.sna input must be an adjacency matrix/array, network, or list.")
        }
    }
    if (is.list(g)) {
        if (length(g) == 1) {
            g <- g[[1]]
            if ((!simplify) && (length(dim(g)) == 3)) {
                out <- list()
                for (i in 1:dim(g)[1]) out[[i]] <- g[i, , ]
            }
            else {
                out <- g
            }
        }
        else {
            if (simplify) {
                dims <- sapply(g, dim)
                if (is.list(dims)) {
                  mats <- sapply(dims, length)
                  mats[mats == 1] <- 0
                  mats[mats == 2] <- 1
                  mats[mats == 3] <- sapply(dims[mats == 3], 
                    "[[", 1)
                  mats <- cumsum(mats)
                  dims <- sapply(dims, "[", 2)
                }
                else {
                  if (NROW(dims) == 3) 
                    mats <- cumsum(dims[1, ])
                  else mats <- 1:NCOL(dims)
                  dims <- dims[2, ]
                }
                if ((!any(is.null(dims))) && (length(unique(dims)) == 
                  1) && (all(mats > 0))) {
                  out <- array(dim = c(mats[length(mats)], dims[1], 
                    dims[1]))
                  for (i in 1:length(mats)) out[(c(0, mats)[i] + 
                    1):(mats[i]), , ] <- g[[i]]
                }
                else out <- g
            }
            else out <- g
        }
    }
    else {
        if ((!simplify) && (length(dim(g)) == 3)) {
            out <- list()
            for (i in 1:dim(g)[1]) out[[i]] <- g[i, , ]
        }
        else out <- g
    }
    out
}
<bytecode: 0x2a1c2f0>
<environment: namespace:sna>
 --- function search by body ---
Function as.sociomatrix.sna in namespace sna has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(x) %in% c("matrix.csr", "matrix.csc", "matrix.ssr",  : 
  the condition has length > 1
Calls: rgraph -> as.sociomatrix.sna -> lapply -> FUN
Execution halted