CRAN Package Check Results for Package networktools

Last updated on 2019-12-11 22:51:15 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.2.1 14.14 130.38 144.52 ERROR
r-devel-linux-x86_64-debian-gcc 1.2.1 13.06 96.49 109.55 OK
r-devel-linux-x86_64-fedora-clang 1.2.1 184.08 OK
r-devel-linux-x86_64-fedora-gcc 1.2.1 168.50 OK
r-devel-windows-ix86+x86_64 1.2.1 47.00 218.00 265.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.2.1 74.00 206.00 280.00 OK
r-patched-linux-x86_64 1.2.1 12.42 111.71 124.13 OK
r-patched-solaris-x86 1.2.1 235.50 OK
r-release-linux-x86_64 1.2.1 11.07 112.85 123.92 OK
r-release-windows-ix86+x86_64 1.2.1 36.00 128.00 164.00 OK
r-release-osx-x86_64 1.2.1 OK
r-oldrel-windows-ix86+x86_64 1.2.1 21.00 117.00 138.00 OK
r-oldrel-osx-x86_64 1.2.1 OK

Check Details

Version: 1.2.1
Check: examples
Result: ERROR
    Running examples in 'networktools-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: expectedInf
    > ### Title: Expected Influence
    > ### Aliases: expectedInf
    >
    > ### ** Examples
    >
    > out1 <- expectedInf(cor(depression[,1:5]))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    networktools
     --- call from context ---
    coerce_to_adjacency(network, directed = directed)
     --- call from argument ---
    if (class(input) == "igraph") {
     if (is.null(E(input)$weight)) {
     mat <- as.matrix(igraph::get.adjacency(input, type = "both"))
     }
     else {
     mat <- as.matrix(igraph::get.adjacency(input, type = "both",
     attr = "weight"))
     }
     if (is.null(directed)) {
     directed <- igraph::is_directed(input)
     }
    } else if (class(input) == "qgraph") {
     col1 <- input$Edgelist$from
     col3 <- input$Edgelist$to
     edgelist <- as.data.frame(cbind(col1, col3, input$Edgelist$weight))
     if (is.null(input$graphAttributes$Nodes$names) | input$graphAttributes$Nodes$names[1] ==
     TRUE) {
     nodes <- 1:length(unique(c(col1, col3)))
     }
     else {
     nodes <- input$graphAttributes$Nodes$names
     }
     mat <- matrix(0, length(nodes), length(nodes))
     colnames(mat) <- rownames(mat) <- nodes
     mat[as.matrix(edgelist)[, 1:2]] <- edgelist[, 3]
     if (is.null(directed)) {
     if (TRUE %in% input$Edgelist$directed) {
     directed <- TRUE
     }
     else {
     directed <- FALSE
     }
     }
     if (!directed) {
     mat <- mat + t(mat)
     }
    } else if (dim(input)[1] == dim(input)[2]) {
     mat <- as.matrix(input)
     if (is.null(directed)) {
     if (sum(mat[upper.tri(mat)], na.rm = T) == 0 | sum(mat[lower.tri(mat)],
     na.rm = T) == 0) {
     directed <- FALSE
     mat[is.na(mat)] <- 0
     mat_t <- t(mat)
     diag(mat_t) <- 0
     mat <- mat + mat_t
     }
     else {
     directed <- !isSymmetric(unname(mat))
     }
     }
     if (is.null(rownames(mat)) & is.null(colnames(mat))) {
     colnames(mat) <- rownames(mat) <- paste("node", 1:dim(mat)[2],
     sep = "")
     }
     else if (is.null(rownames(mat))) {
     rownames(mat) <- colnames(mat)
     }
     else if (is.null(colnames(mat))) {
     colnames(mat) <- rownames(mat)
     }
     else if (TRUE %in% c(rownames(mat) != colnames(mat))) {
     rownames(mat) <- colnames(mat)
     }
    } else {
     stop("Invalid input: please use an object of class qgraph, igraph, or an adjacency matrix")
    }
     --- R stacktrace ---
    where 1: coerce_to_adjacency(network, directed = directed)
    where 2: expectedInf(cor(depression[, 1:5]))
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (input, directed = NULL)
    {
     if (class(input) == "igraph") {
     if (is.null(E(input)$weight)) {
     mat <- as.matrix(igraph::get.adjacency(input, type = "both"))
     }
     else {
     mat <- as.matrix(igraph::get.adjacency(input, type = "both",
     attr = "weight"))
     }
     if (is.null(directed)) {
     directed <- igraph::is_directed(input)
     }
     }
     else if (class(input) == "qgraph") {
     col1 <- input$Edgelist$from
     col3 <- input$Edgelist$to
     edgelist <- as.data.frame(cbind(col1, col3, input$Edgelist$weight))
     if (is.null(input$graphAttributes$Nodes$names) | input$graphAttributes$Nodes$names[1] ==
     TRUE) {
     nodes <- 1:length(unique(c(col1, col3)))
     }
     else {
     nodes <- input$graphAttributes$Nodes$names
     }
     mat <- matrix(0, length(nodes), length(nodes))
     colnames(mat) <- rownames(mat) <- nodes
     mat[as.matrix(edgelist)[, 1:2]] <- edgelist[, 3]
     if (is.null(directed)) {
     if (TRUE %in% input$Edgelist$directed) {
     directed <- TRUE
     }
     else {
     directed <- FALSE
     }
     }
     if (!directed) {
     mat <- mat + t(mat)
     }
     }
     else if (dim(input)[1] == dim(input)[2]) {
     mat <- as.matrix(input)
     if (is.null(directed)) {
     if (sum(mat[upper.tri(mat)], na.rm = T) == 0 | sum(mat[lower.tri(mat)],
     na.rm = T) == 0) {
     directed <- FALSE
     mat[is.na(mat)] <- 0
     mat_t <- t(mat)
     diag(mat_t) <- 0
     mat <- mat + mat_t
     }
     else {
     directed <- !isSymmetric(unname(mat))
     }
     }
     if (is.null(rownames(mat)) & is.null(colnames(mat))) {
     colnames(mat) <- rownames(mat) <- paste("node", 1:dim(mat)[2],
     sep = "")
     }
     else if (is.null(rownames(mat))) {
     rownames(mat) <- colnames(mat)
     }
     else if (is.null(colnames(mat))) {
     colnames(mat) <- rownames(mat)
     }
     else if (TRUE %in% c(rownames(mat) != colnames(mat))) {
     rownames(mat) <- colnames(mat)
     }
     }
     else {
     stop("Invalid input: please use an object of class qgraph, igraph, or an adjacency matrix")
     }
     attr(mat, "directed") <- directed
     return(mat)
    }
    <bytecode: 0xb5c7f60>
    <environment: namespace:networktools>
     --- function search by body ---
    Function coerce_to_adjacency in namespace networktools has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(input) == "igraph") { : the condition has length > 1
    Calls: expectedInf -> coerce_to_adjacency
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang