igraph-help
[Top][All Lists]
Advanced

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

[igraph] Re: Hello


From: Walk to Sun
Subject: [igraph] Re: Hello
Date: Fri, 13 Feb 2009 05:49:38 +0800

Dear Dr Gábor Csárdi ,

 

Thank you. I could generate most graph in the webpage except for a few ones which begin with “from igraph import *”

 

 

Best regards

W

ps: Below are selections of codes. 

 

1. The Fruchterman-Reingold layout algorithm

> library(igraph)

> library(Cairo)

> source("frgraphs.R")

Error in source("frgraphs.R") :

  frgraphs.R: unexpected symbol at

41:   graphs[[16]] <- simplify(graphs[[16]])

42:   return graphs

 

> graphs <- frgraphs()

Error: could not find function "frgraphs"

> lay <- lapply(graphs, layout.fruchterman.reingold, niter=3000)

Error in is.vector(X) : object "graphs" not found

>

> CairoX11()

Error in Cairo(width, height, file = display, type = "x11", pointsize = pointsize,  :

  cairo library was compiled without XLIB back-end.

> # CairoPNG(file="frplots.png")

> par(mai=c(0,0,0,0))

> layout(matrix(1:16, nr=4, byrow=TRUE))

> layout.show(16)

> for (i in seq(along=graphs)) {

+   plot(graphs[[i]], layout=lay[[i]],

+        vertex.label=NA, vertex.size=13, edge.color="black",

+        vertex.color="red")

+ }

Error in seq(along = graphs) : object "graphs" not found

> # dev.off()

> local({pkg <- select.list(sort(.packages(all.available = TRUE)))

+ if(nchar(pkg)) library(pkg, character.>

 

 

 

2. The tkplot editor of the R package

> coords <- tkplot.getcoords(7)

Error in eval(expr, envir, enclos) : object "tkp.7" not found

 

 

3. Components of an Erdős-Rényi random graph

> from igraph import *

Error: unexpected symbol in "from igraph"

>

> g = Graph.Erdos_Renyi(n=300, m=250)

Error: could not find function "Graph.Erdos_Renyi"

> colors = ["lightgray", "cyan", "magenta", "yellow", "blue", "green", "red"]

Error: unexpected '[' in "colors = ["

> for component in g.components():

Error: unexpected symbol in "for component"

>   color = colors[min(6, len(component)-1)]

Error: could not find function "len"

>   for vidx in component: g.vs[vidx]["color"] = color

Error: unexpected symbol in "  for vidx"

>  

> plot(g, layout="fr", vertex_label=None)

Error in i.parse.plot.params(graph, list(...)) : object "None" not found

 

 

4: Kautz graph and its adjacency matrix

> g = Graph.Erdos_Renyi(n=300, m=250)

Error: could not find function "Graph.Erdos_Renyi"

> colors = ["lightgray", "cyan", "magenta", "yellow", "blue", "green", "red"]

Error: unexpected '[' in "colors = ["

> for component in g.components():

Error: unexpected symbol in "for component"

>   color = colors[min(6, len(component)-1)]

Error: could not find function "len"

>   for vidx in component: g.vs[vidx]["color"] = color

Error: unexpected symbol in "  for vidx"

>  

> plot(g, layout="fr", vertex_label=None)

Error in i.parse.plot.params(graph, list(...)) : object "None" not found

> Kautz graph and its adjacency matrix

 

 

 

 

 

 

 

 

----- Original Message -----
From: "Gábor Csárdi" <address@hidden>
To: "Walk to Sun" <address@hidden>
Sent: Thursday, February 12, 2009 5:41 PM
Subject: Re: Hello

On Thu, Feb 12, 2009 at 1:29 AM, Walk to Sun <address@hidden> wrote:
What is the error message do you get?

You can even read the karate.net file from the web:

g <- read.graph("http://cneurocvs.rmki.kfki.hu/igraph/karate.net",
format="pajek")

and then run the rest of the code.

G.

> Dear Dr Gábor Csárdi  and Peter,
>
> Thank you for your help.  I had tried both  typing "source" function  and removing CairoX11() line. All my endeavours are in vain.  Can anyone type the text beside that figure into R ?  I want to know the program which can create graph in below page.
>
> http://cneurocvs.rmki.kfki.hu/igraph/screenshots2.html#10
>
>
> Best regards
>
> W
>
>
>
> ----- Original Message -----
> From: "Gábor Csárdi" <address@hidden>
> To: "Walk to Sun" <address@hidden>
> Cc: <address@hidden>
> Sent: Thursday, February 12, 2009 3:36 AM
> Subject: Re: Hello
>
>
> W,
>
> On Wed, Feb 11, 2009 at 5:40 PM, Walk to Sun <address@hidden> wrote:
>> Dear Dr Gábor Csárdi ,
>>
>> I have read  the text beside that figure many times and have download "frgraphs.R", but still cannot run the program.
>> http://cneurocvs.rmki.kfki.hu/igraph/screenshots2.html#10
>
> Peter already answered this. And the Cario error you can simply
> ignore, or just remove the CairoX11() line from the code.
>
>> The research can be "trade liberalisation  in OECD"
>
> It wasn't actually a real question of mine, I just wanted to point out
> that you should define yourself what kind of network you want to build
> based on what your research goal is. We cannot solve this problem for
> you. As Peter pointed out, this is not the right forum for it, either.
>
> G.
>
>> Best regards
>> W
>>
>> ----- Original Message -----
>> From: "Gábor Csárdi" <address@hidden>
>> To: "Walk to Sun" <address@hidden>
>> Cc: <address@hidden>
>> Sent: Thursday, February 12, 2009 12:01 AM
>> Subject: Re: Hello
>>
>>
>> W,
>>
>> On Wed, Feb 11, 2009 at 4:51 PM, Walk to Sun <address@hidden> wrote:
>>> Dear Dr Gábor Csárdi ,
>>>
>>> I am glad to read your reply. Your explaination is very helpful and very
>>> clear.
>>>
>>> In order to generate a random graph with each node representing a district,
>>> what data should I collect ?
>>
>> How am I supposed to know that? What is your research question?
>>
>>> Data which can repersent relation and
>>> attributes?
>>
>> If you like.
>>
>>> Do I need to calculate betweenness  or in/Out degree before
>>> loading data into R?
>>
>> Why would you?
>>
>>> Besides, I cannot run the program in below pages. Where can I download
>>> dataset?
>>
>> How about reading the text beside that figure?
>>
>> G.
>>
>>> http://cneurocvs.rmki.kfki.hu/igraph/screenshots2.html#10
>> [...]
>>
>> --
>
>
>
> --
> Gabor Csardi <address@hidden>     UNIL DGM



--
Gabor Csardi <address@hidden>     UNIL DGM

reply via email to

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