igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] graph.disjoint.union help


From: Gábor Csárdi
Subject: Re: [igraph] graph.disjoint.union help
Date: Fri, 17 Apr 2009 08:18:02 +0200

Yeah, that would make sense. It has been on the todo list for a while,
I just could not decide what to do with the corner cases (e.g. graph1
has a numeric, graph2 a character attribute with the same name, etc.).
But know as I look at it again, it does not seem to be too difficult.

Right now a workaround is to use that the order or the vertices is kept:

g1 <- graph.ring(10)
V(g1)$name <- letters[1:10]
g2 <- graph.tree(10, mode="undirected")
V(g2)$name <- LETTERS[1:10]

###

g <- graph.disjoint.union(g1, g2)
V(g)$name <- c(V(g1)$name, V(g2)$name)

Thanks,
G.

On Fri, Apr 17, 2009 at 1:36 AM, Romildo Martins
<address@hidden> wrote:
> Hi,
>
> is possible used the function graph.disjoint.union and retain the vertice 
> names?
>
> Thanks!
>
> RMB
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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