[R] need help in igraph package of R

bababasi slounios at incognitomail.net
Thu May 13 19:07:57 CEST 2010


hi 

I am struck with a problem in igraph package of R. My problem is as follows

I want to plot a power law fit for my data (in .net format --- pajek format)

syntax for that in R is

g <- read.graph("filename.net", "pajek")
d <- degree (g, mode="in")
power.law.fit (d+1, 2)

it gives me desired out put if my if input a single file

but I want to use a  variable file name ( such as name1, name2 ) so that I
can read all my 100 files at a single stretch if I put this entire code in a
loop.

names = "name1" "name2" "name3".....

while (i <= 100)
g <- read.graph("names[i]", "pajek")
d <- degree (g, mode="in")
power.law.fit (d+1, 2)
i <- i + 1
}

but names[i] does n't seem to work. Is there any alternative ?

I want to know how to use  a variable file name in this syntax

Any help is greately appreciated

barabasi
 
-- 
View this message in context: http://r.789695.n4.nabble.com/need-help-in-igraph-package-of-R-tp2197863p2197863.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list