Yup, if it's a square matrix then your code looks fine to me. -- T.
On 3 May 2013, at 15:38, Marco Antoniazzi <[email protected]> wrote: > Hi, > > thank you for your answer, I didn't write the whole matrix in the table just > for semplication, but it is a square matrix. So everything should be fine > right? > > thank you! > > > 2013/5/3 Tamás Nepusz <[email protected]> > Hi, > > > Import the txt file which looks as following (The first row specifies the > > code for the different nodes, the other rows specifies the weights of > > edges). > How come that your input file is not a square matrix? It seems to have 8 rows > and 13 columns -- where are the 5 missing rows and the 5 missing node names? > > Otherwise what you do seems okay for me. > > > IS it ok for igraph to have the name of the nodes just in the first row and > > not in the first column to generate an adjacency matrix? i have read > > somewhere it is the same as having the first column with 'A','B','C',etc > igraph doesn't care -- it does not read your file, it reads the matrix that > you loaded with read.table. If the matrix looks fine in R, then it should be > okay for igraph as well. > > > I want then to calculate the betweenness, that will return a result for > > each node, but I am not sure whether the weights are inserted correctly in > > the function. > Seems okay for me, assuming that your input matrix is correct -- which is > still a bit weird for me because of the missing rows. > > > Is there a way I can check the results using other programs? > Of course -- find another program that can calculate weighted betweenness > scores and compare the results ;) One possible option is the NetworkX module > for Python if you know the Python language. (igraph also has a Python > interface but it would be quite useless to compare igraph in Python vs igraph > in R because they use the same implementation). > > -- > T. > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
