An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081227/d6f6adfb/attachment.pl>
question about SNA in R, thanks!
2 messages · Weijia You, Gábor Csárdi
Weijia
see ?degree for the degree and ?cor for the correlation. E.g.
mixing <- function(g) {
el <- get.edgelist(g)
deg <- degree(g)
cor(deg[el[,1]+1], deg[el[,2]+1])
}
You need to modify the degree() call to take edge direction into account.
Gabor
ps. FYI, there is also an igraph missing list, in case I miss your
messages on R-help and nobody else answers either.
On Fri, Dec 26, 2008 at 5:48 PM, Weijia You <weijiawx at gmail.com> wrote:
Dear colleagues, I'm trying to have a look at the Assortative and Disassortative ( http://en.wikipedia.org/wiki/Assortative_mixing) of the network I have. But it seems that the igraph hasn't mentioned that yet. I have to get the in/out degree of the vertices of each edge and calculate the Pearson's Correlation coefficient which seems to be quite a huge task for me. :( So I wonder if anyone had done that before and give me some hints on it? Thank you in anticipation! Weijia [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list 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.
Gabor Csardi <Gabor.Csardi at unil.ch> UNIL DGM