[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Leverage centrality implementation in igraph
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Leverage centrality implementation in igraph |
Date: |
Sun, 29 Jul 2012 21:36:52 +0200 |
Thanks Alex, I have added this to the igraph wiki at
http://igraph.wikidot.com/r-recipes
Best,
--
T.
On Friday, 27 July 2012 at 15:44, Alex Upton wrote:
>
> Thank you Tamás for your help, I have implemented it and it works. If anyone
> else is interested in using it, I have put the code in the format of a
> function, which is as follows:
>
> lvcent <- function(graph){
>
> k <- degree(graph)
> n <- vcount(graph)
>
> sapply(1:n, function(v) { mean((k[v]-k[neighbors(graph,v)]) /
> (k[v]+k[neighbors(graph,v)])) })
>
> }
>
>
> Kind 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 (mailto:address@hidden)
>
> Personal Web: http://postgrad.eee.bham.ac.uk/uptona/
> --------------------------------------------------------------------------------------------
> _______________________________________________
> igraph-help mailing list
> address@hidden (mailto:address@hidden)
> https://lists.nongnu.org/mailman/listinfo/igraph-help