Answered here: http://stackoverflow.com/questions/20171500/how-to-name-vertices-with-contract-vertices-according-to-names-of-mapping-vect
G. On Sun, Nov 24, 2013 at 12:48 AM, <[email protected]> wrote: > I wanted the "id" and "name" of the vertices of the new graph to be > respectively "digit" and "char". In other words, "id" and "name" should > indicated the vertex attribute on which the new graph (g2) was contracted on > so to give > > print(get.data.frame(g2, what="vertices")) > > # name > # digit digit > # char char > > instead of > > print(get.data.frame(g2, what="vertices")) > # name > # c("A", "B") A, B > # c("1", "2") 1, 2 > > Il 24.11.2013 05:43 Gábor Csárdi ha scritto: > >> On Sun, Nov 24, 2013 at 12:20 AM, <[email protected]> wrote: >>> >>> g2 <- contract.vertices(g, factor(V(g)$category)) >>> >>> still gives >>> >>> print(get.data.frame(g2, what="vertices")) >>> name >>> >>> c("A", "B") A, B >>> c("1", "2") 1, 2 >> >> >> Yes, 'A' and 'B' are contracted into 'A, B' and '1' and '2' are >> contracted into '1, 2'. Isn't this what you wanted? >> >> Gabor > > > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
