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

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to