Well, the thing is, it is still not OK. I really don't want to make this too hard, but ideally what I want is a piece of _self-contained_ code, that I can just copy and paste into an R session. Reading files is OK, but I still had to edit the file name and complete your code to make it run. And your code in the last email is not the same as in the first.
These might seem small things to you, but it took me ~10 minutes to check your problem. If you send self-contained code, it takes 1 minute, or less and I would have probably replied earlier, I just did not have ~20 minutes for this. Don't take this personally, please, sending good bug reports is a skill. OK, enough ranting for today. So it seems like the problem is that when you write 'weighted=NULL' for graph.adjacency(), and your data is not binary but contains some larger numbers as well, it will create a network with multiple edges, i.e. 4 in your adjacency matrix creates 4 edges between the vertices. This might not be the best default behavior, but this is how it is. If you want to get rid of the multiple edges, call simplify() on the graph. Best, Gabor On Thu, May 16, 2013 at 3:24 AM, Marco Antoniazzi < [email protected]> wrote: > Hi gabor, here is how I import the matrix and calculate the betweenness. > > TabA <- read.csv("~/Desktop/DATI TOTALI/MATRICI INIZIALI/2006/T1_011 > copia.TXT") > > network <- as.matrix ( TabA ) > networkg <- graph.adjacency ( network, mode=c("directed"), weighted = TRUE > ) > networkbet <- betweenness ( networkg, directed = TRUE, weights = E ( > networkg )$weight ) > > is it ok now or you need something else? > > thanks > Marko > > > > > 2013/5/16 Gábor Csárdi <[email protected]> > >> Again, please send some self-contained code. Maybe you are not creating >> the graphs you intended to, maybe you create a graph with multiple edges, >> and that's not what you want. Hard to guess. It is much easier if you show >> your complete code that generates the results you don't like. >> >> Gabor >> >> >> On Thu, May 16, 2013 at 2:42 AM, Marco Antoniazzi < >> [email protected]> wrote: >> >>> Hi gabor, >>> >>> you can try with these two matrices, one is weighted and the other >>> binary. >>> thanks >>> >>> Marko >>> >>> >>> 2013/5/16 Gábor Csárdi <[email protected]> >>> >>>> On Mon, May 13, 2013 at 2:35 AM, Antoniazzi Marco < >>>> [email protected]> wrote: >>>> >>>>> thank you Gabor, >>>>> >>>>> I don't understand the difference between weights=NULL and weights >>>>> =TRUE then when I create a graph object. >>>>> >>>> >>>> Sorry, my bad, I probably misunderstood your question. Can you please >>>> send some self-contained code, ie. that has everything and I can run it? >>>> Your code does not have the matrices, so I cannot reproduce your problem. >>>> Thanks. >>>> >>>> Gabor >>>> >>>> [...] >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> >> >> -- >> Gabor Csardi <[email protected]> MTA KFKI RMKI >> >> _______________________________________________ >> 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 > > -- Gabor Csardi <[email protected]> MTA KFKI RMKI
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
