[R] Network Graph Add Labels

Brock Tibert btibert3 at yahoo.com
Fri Dec 4 19:25:29 CET 2009


Hi Everyone,

I am new to R and just trying my hand at plotting a network from my dataset.  I am trying to teach myself network analysis, so this is probably an easy question.

Using the package network, I have successfully plotted my network.  I simply want to add labels to my vertices, with the label corresponding to the data I fed into the edgelist.  For simplicity sake, my edgelist looks like

1  4
3  4

I want to plot the labels, 1, 3, 4, and so on.

Here is my code.

library(network)
path <- path
myedges <- read.table(path)
net <- network(myedges)
plot(net)

Any help will be greatly appreciated.  I am not looking to do advanced analysis, just plotting it to get going is all I really need.

Many thanks in advance for help and/or suggestions,

Brock




More information about the R-help mailing list