igraph-help
[Top][All Lists]
Advanced

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

[igraph] Change order of vertices in an igraph object


From: Hermann Norpois
Subject: [igraph] Change order of vertices in an igraph object
Date: Wed, 20 Nov 2013 16:23:33 +0100

Hello,

having an igraph object sig (see below) I am looking for a way to change the order of vertices in reference to x.
So I guess I have something to use like
idx -> order (V(sig)$x)
to get a new index. But how do I insert this index in the igraph object to get a newly ordered igraph object?

Thanks Hermann

> dput (sig)
structure(list(13, TRUE, c(0, 0, 1, 6, 6, 6, 7, 7, 8, 9, 11),
    c(1, 3, 3, 7, 11, 12, 11, 12, 9, 10, 12), c(0, 1, 2, 3, 4,
    5, 6, 7, 8, 9, 10), c(0, 1, 2, 3, 8, 9, 4, 6, 5, 7, 10),
    c(0, 2, 3, 3, 3, 3, 3, 6, 8, 9, 10, 10, 11, 11), c(0, 0,
    1, 1, 3, 3, 3, 3, 4, 4, 5, 6, 8, 11), list(c(1, 0, 1), structure(list(), .Names = character(0)),
        structure(list(name = c("rs5761629", "rs12628704", "rs2267104",
        "rs5761630", "rs5761631", "rs4822752", "rs58450956",
        "rs16982453", "rs5761635", "rs2283843", "rs5997109",
        "rs16982454", "rs76095025"), x = c(27005470L, 27006136L,
        27006308L, 27006698L, 27007269L, 27011420L, 27014346L,
        27014428L, 27014467L, 27017300L, 27017435L, 27017996L,
        27018001L), y = c(0.887869230924378, 0.654212551439585,
        0.755969155644639, 0.895054710863134, 0.591152110066053,
        0.841717655905212, 1, 1, 0.79443719113136, 0.794554251603377,
        0.435233706137542, 1, 1)), .Names = c("name", "x", "y"
        )), structure(list(weight = c(0.920156, 0.986379, 0.905977,
        1, 1, 1, 1, 1, 0.944149, 0.822451, 1)), .Names = "weight"))), class = "igraph")
>


reply via email to

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