[R] QuACN package: getLargestSubgraph -> .validateGraph error

Raphael Prates raphaelprates at outlook.com
Wed Mar 9 01:21:28 CET 2016


I am trying to create a network from the matrix that is attached.


> matrixSelecionada <- read.csv("matrix.csv", header = FALSE)

> matrixSelecionada <- data.matrix(matrixSelecionada)


## changing the values of the matrix


> for (i in 1:nrow(matrixSelecionada)) {
                for (j in 1:ncol(matrixSelecionada)) {
                        if (matrixSelecionada[i,j] < 0.01 || i==j) {
                        matrixSelecionada[i,j] <- 0
               } else if (matrixSelecionada[i,j]>=0.01) {
                        matrixSelecionada[i,j] <- 1
                }

                }
                }
> g <- as(matrixSelecionada, "graphNEL")
> g

A graphNEL graph with directed edges
Number of Nodes = 56
Number of Edges = 1256

> glg <- getLargestSubgraph(g)

Error: .validateGraph(g) is not TRUE


But when I do validateGraph

> validGraph(g)
[1] TRUE



More information about the R-help mailing list