a

a

A network graph made using the Igraph R package.

This is a contribution of Koba Khitalishvili.

If you want to make a network graph from a distance matrix, have a look to graph #7.

The gallery also contains this graph in an interactive mode using d3.js, have a look to graph #87 !

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# Create data with the randomNames package : library('randomNames') NUMOFLINKS = 100 relations = data.frame(source = randomNames(1000,which.names='both'), target = "") relations = relations[rep(seq_len(nrow(relations)), sample(1:10,nrow(relations), replace=T)),] relations = relations[sample(nrow(relations),NUMOFLINKS),] relations$target = sample(relations$source,nrow(relations), replace = T) relations = relations[relations[,1]!=relations[,2], ] # Have a look to the input table ! head(relations) ## Plot the graph using the IGRAPH package library("igraph") vertices<-data.frame("name" = unique(unlist(relations))) # node names g = graph.data.frame(relations, directed=F, vertices=vertices) # raw graph vertices$group = edge.betweenness.community(g)$membership # betweeness centrality for each node for grouping plot(g, #mark.groups=vertices$group, # group vertices by betweeness indicator (redish blob background) layout=layout.auto, vertex.color = vertices$group, # color vertices by edge betweeness vertex.label=NA, # no vertex label (name) vertex.size=5, edge.arrow.size=0.8) |

Not what you are looking for ? Make a new search !

`[mediatagger]`

## Leave a Reply