igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] question about edge weights


From: Jessie Gunter
Subject: [igraph] question about edge weights
Date: Mon, 16 Jul 2012 13:51:51 -0400

Hello,

I am using igraph to reshape a dataframe and create a graph with weighted edges between nodes. I melted the dataframe and used this...

> E23_new<-data.frame(id=E23[,1],var=E23.contacts,value=E23.recode)

to make the dataset look like this:

> head(E23_new)
     id      var      value
1 23002 Chief     4
2 23003 Chief     4
3 23004 Chief     3
4 23005 Chief     3
5 23006 Chief     3
6 23007 Chief     2

I am trying to make the "value" column the edge weights.  I had no luck with this:

g <- set.edge.attribute(g, "weight", value=E23.recode)

How can I weight the edges according to the number in the value column?  Right now they are all weighted 1.0.

Any help would be greatly appreciated.  Thanks in advance.

-Jessie

reply via email to

[Prev in Thread] Current Thread [Next in Thread]