I managed to perform this operation in order to make a visual representation of node degree using the following code:
Datamatrix <- as.matrix(data[c("first","second")])
CVET <- graph_from_edgelist(Datamatrix, directed=TRUE)
DCVET=degree(CVET)
plot(CVET,
vertex.color=rainbow(52),
vertex.size=DCVET*0.5,
vertex.label.cex=0.6,
edge.arrow.size=0.1,
layout=layout.kamada.kawai)
This produced the following plot:
When I tried to do the same using an other property of the nodes (betweenness) I obtained a graph that was unreadable. This is likely due to the fact that some values were huge when compared to others. The code and plot I obtained are here:
data<-read.csv(file.choose(), header=T)
data
Datamatrix <- as.matrix(data[c("first","second")])
CVET <- graph_from_edgelist(Datamatrix, directed=TRUE)
BCVET= betweenness(CVET, directed=TRUE)
plot(CVET,
vertex.color=rainbow(52),
vertex.size=BCVET*6,
main='Betweenness',
vertex.label.cex=0.6,
edge.arrow.size=0.1,
layout=layout_nicely)
I'm looking for a way to display the second graph eliminating the smaller value so that the most important nodes in term of betweenness become apparent. I have tried various different layout options but didn't manage to do it. Could someone help?