[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Still having issues with weighted betweenness calculations
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] Still having issues with weighted betweenness calculations using igraph in 64-bit windows |
Date: |
Thu, 17 May 2012 10:27:44 -0400 |
On Wed, May 16, 2012 at 3:21 PM, Alex Upton <address@hidden> wrote:
> Dear all,
>
> I was kindly provided with a windows package for igraph 0.6, thank you Gábor
> Csárdi, to calculate the weighted betweenness centrality, however I am
> getting the error message:
>
> Error in betweenness(g1, weights = TRUE) :
> At centrality.c:1454 : Weight vector length does not match, Invalid value
I sense some confusion here. You need to pass the actual weight vector
to the betweenness function:
betweenness(g1, weights=myweights)
or add weights as an edge attribute:
E(g1)$weight <- myweights
betweenness(g1)
Gabor
> I entered some of the code in the function manually: weights <-
> E(graph)$weight
>
> to check what the variable weights called is and the length, and it is:
>
> length(weights)
> [1] 31996000
>
> Which is the same as:
>
> ecount(g1)
> [1] 31996000
>
> I previously read that this error was due to the weights vector length not
> being equal to the number of edges in the graph, however this would not seem
> to be the case, using the code: , which is contained within the betweenness
> function. I am calling the function as such:
>
> wb1 <- betweenness(g1, weights = TRUE)
>
> which I believe is the correct way. I am a little confused now as to why
> there is an error, could anyone help me with this?
>
>
> Regards
>
> Alex
>
> ___________________________________________________________________
>
>
>
> Alex Upton, BEng, MRes, PG Cert Business Administration
> PhD Researcher Biomedical Informatics, Signals and Systems
> School of Electronic, Electrical and Computer Engineering,
> College of Engineering and Physical Sciences, University of Birmingham
> Edgbaston, Birmingham, B15 2TT, United Kingdom
>
> Fax: +44 121 4144291 (school general office)
> Email: address@hidden
>
> Personal Web: http://postgrad.eee.bham.ac.uk/uptona/
> __________________________________________________________________
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
--
Gabor Csardi <address@hidden> MTA KFKI RMKI