igraph-help
[Top][All Lists]
Advanced

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

[igraph] Re: Analyzing Graphs with Non-standard Node Labeling


From: Gábor Csárdi
Subject: [igraph] Re: Analyzing Graphs with Non-standard Node Labeling
Date: Wed, 8 Jul 2009 13:44:34 +0200

Lorenzo,

On Wed, Jul 8, 2009 at 12:39 PM, Lorenzo Isella<address@hidden> wrote:
> Hi Gabor,
> And thanks for your help. This works brilliantly, apart from one case:
> suppose that  (as it actually happens) my edge list shrinks to only a couple
> of connected nodes
> e.g.:
>
> 1101 1187
>
> Then using graph.data.frame raises an error  (but it is still a  legitimate
> graph)
>
> l<-graph.data.frame(mydata,dir=FALSE)
> Error in if (ncol(d) < 2) { : argument is of length zero

What is 'mydata' here? Because graph.data.frame works fine, even if
the data frame has a single line only:

> library(igraph)
> df <- data.frame(from=1101, to=1187)
> l <- graph.data.frame(df, dir=FALSE)
> l
Vertices: 2
Edges: 1
Directed: FALSE
Edges:
    e
e [0] '1101' -- '1187'

G.

> There are many ways to tackle this problem, but I would like not to lose the
> info about the vertex names (i.e. I would like to extend the procedure you
> suggested even to trivial graphs). The reason I am posting this is that I
> need to post-process a list of time-evolving networks (automatically) and I
> do not know beforehand the properties of the network I need to analyze.
> Many thanks

[...]

-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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