1

I am working on degree assortativity. I have calculated degree assortativity using R using igraph package.I tried this code but it only calculates overall degree assortativity value

[library(igraph)
datafile <- "c:\\Users\\Alex\\Desktop\\data.csv"
sd_edgelist <- read.csv(datafile)
sd_edgelist <- sd_edgelist\[, 1:9 \]
head(sd_edgelist)
g <- graph.data.frame(sd_edgelist, directed = FALSE)
assortativity_degree(g, directed=FALSE)
    #\[1\] -0.6721889][1]

i want to calculate every node assortativity value and then want to plot scatter plot like this how this can be done ? i didnt find any builtin function i R for calculating assortativity for every node After calculating assortativity value for every node i want scatter plot like this plot [Open link to see image of scatter plot]

https://www.google.com.pk/search?q=degree%20assortativity%20plot&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjjnLyO7d_TAhUh6oMKHYwmBv4Q_AUICigB#imgrc=QWHV9xLoYCDnXM:

user12
  • 761
  • 8
  • 24
  • 2
    It would help if you provided a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data. Clearly describe the desired output (what would the x and y axis be for your scatter plot). Describe how you exactly you want to calculate a per-node assortativity value. – MrFlick May 11 '17 at 14:00
  • 1
    we would iterate over nodes and for every node checked neighbourhood A, and similar node set B AUB/(A+B) ~ assortativity .... we can fine-tune formula for assotrativity computation.... ~ stands for 'more or less close to' – user12 May 13 '17 at 18:02
  • on x-axis the degree and on y axis we have average degree of neighbours.. see attached scatter plot in the post – user12 May 13 '17 at 18:07
  • on x-axis the degree and on y axis we have average degree of neighbours.. see the link embeded in post for required scatter plot – user12 May 13 '17 at 18:13
  • 1
    for graph G with N nodes we need to have 1) degree for every node 2) degree assortativity for every node 3) plot these two 1-dimensional vectors of lenght N in lolglog scale (matplotlib has this function) – user12 May 14 '17 at 09:35

0 Answers0